필터 지우기
필터 지우기

How to plot specific graph

조회 수: 1 (최근 30일)
Matlabbey
Matlabbey 2012년 9월 8일
hello all
im trying to graph in a certain way and was hoping to learn how to do this. attatched is what im trying to do but not sure how to do it in matlab. thank you!!

채택된 답변

Image Analyst
Image Analyst 2012년 9월 8일
x = 1:4;
y1 = [40 0 0 0];
y2 = [-28 0 0 0];
bar(x, y1, 'FaceColor', 'r');
hold on;
bar(x, y2, 'FaceColor', [.5 .5 .5]);
grid on;
  댓글 수: 2
Matlabbey
Matlabbey 2012년 9월 8일
hi! thanks for the response, but how do i make it so the bottom numbers are not negative? can i make that axis positive also? i'm not sure for the formatting. thank you!!
Image Analyst
Image Analyst 2012년 9월 8일
You can reset the tick labels to be anything you want, for example you could take the absolute value and write them back out as positive. Look up tick labels in the help for examples.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by