how to display colorbar levels from '-10^6' to '10^6' ?
2 ビュー (過去 30 日間)
古いコメントを表示
labels=arrayfun(@(c1_Positive)['10^',int2str(c1_Positive)],c1_Positive,'uniformoutput',false);
set(ax1,'TickLabels',labels);
labels2=arrayfun(@(c1_Negative)['-10^',int2str(c1_Negative)],c1_Negative,'uniformoutput',false);
set(ax1,'TickLabels',labels2);
2 件のコメント
Adam
2018 年 10 月 15 日
What are you trying to achieve and in which version of Matlab?
caxis( [-10^6 10^6] )
will set the colourbar range to that. I don't know what you are trying to do in your code though since you are assigning labels to an axes, and then overwriting them with another set.
In recent versions of Matlab a colourbar is an object rather than an axes explicitly.
回答 (1 件)
Adam
2018 年 10 月 16 日
編集済み: Adam
2018 年 10 月 16 日
c = colorbar;
labels=arrayfun(@(c)['10^',int2str(c)],-6:6,'uniformoutput',false);
set( c, 'TickLabels', labels, 'TickLabelInterpreter', 'none' );
works, but the result is ugly and far less readable than the default way of presenting the information.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Colorbar についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!