MATLAB Colorbar - Same colors, scaled values

前端 未结 2 1271
伪装坚强ぢ
伪装坚强ぢ 2020-12-21 06:12

Consider the following example:

[ X, Y, Z ] = peaks( 30 );
figure( 100 );
surfc( X, Y, Z );
zlabel( \'Absolute Values\' );
colormap jet;
c = colorbar( \'Loca         


        
2条回答
  •  执念已碎
    2020-12-21 07:00

    As I wrote in your answer, I think a better choice for showing two related values is not to create a new axis for that, but to show them one near the other. Here is a suggestion:

    [X,Y,Z] = peaks(30);
    surfc(X,Y,Z);
    zlabel('Absolute (Relative) Values');
    colormap jet
    Z_Scl = 0.01;
    zticks = get(gca,'ZTick');
    set(gca,'ZTickLabel',sprintf('%g (%g)\n',[zticks;zticks.*Z_Scl]))
    

提交回复
热议问题