how to plot clearer angle yticklabels at whole fractions of 360° (and/or fractions of pi, for radians) in stead of decimal
3 ビュー (過去 30 日間)
古いコメントを表示
I've been looking and trying for a while to plot phase angles with yticklabels matching whole fractions of the angle-domains. Eg: [0 45 90 135 180 ...] for degrees, and [0 pi/4 pi/2 3pi/4 ... ] for radians. And automatically adjusting the fractional resolution according to the min and max phase limits of the concerning plot. Is there an easy way to achieve this, or alternatively, any code that deals with this? Thanks in advance! K
0 件のコメント
回答 (1 件)
Iain
2014 年 10 月 20 日
編集済み: Iain
2014 年 10 月 20 日
You can change where the ticks go:
set(axishandle,'YTick', [0 4 6 8 ...] )
You can change the labels as you like:
set(axishandle,'YTickLabel', {'Five' 'Banana' .... } )
2 件のコメント
Iain
2014 年 10 月 20 日
Ok, what you CAN do is:
1. Determine the X/Y limits of the chart.
2. Figure out where you want your ticks to go. - Say every 8th of the range, rounded to the nearest nice value?
3. Issue the set tick location & label commands.
4. Attach that code to the zoom, pan & rotate callbacks...
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!