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!