is it possible to format the x-axis so that it goes from high to low to high?
조회 수: 4 (최근 30일)
이전 댓글 표시
I am trying to graph a Utah water year which starts on Oct 1 one year and ends Oct 1 the next. I have changed the date strings to numbers and then changed the datenumbers to a day of year. Then I changed the day of year to a fractional year, meaning oct. 1 is about .8, jan 1 is 0.0 and June is about 0.5. I want the x-axis to start @ Oct 1 (0.8) and end at 0.8, so 0.0 (Jan.1) is in the middle. Anyone know how I would approach this?
댓글 수: 0
답변 (1개)
Walter Roberson
2013년 4월 26일
Does the axis itself need to be like that? If it does you are going to need multiple axes. For example if you need data brushing to be able to work on it, then you have a problem. If you need zoom and pan to be able to work on it, or datacursor, then it gets messy but could be fudged.
If it is only a matter of the axis label, then you can set xticklabel to display different things. For example,
curxtick = get(gca, 'XTick');
set( 'xticklabel', cellstr(num2str(mod(curxtick(:),1))) );
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!