0

plotyy を使用して、同じ図の異なる軸に 2 つの曲線をプロットしています。最初の曲線の範囲は 10^-4 から 10^-1 で、2 番目の曲線の範囲は 0 から 10 です。次のようにプロットすると、

[AX, H1, H2] = plotyy(x, y1, x, y2, 'セミロジー', 'セミロジー');

それらは両方ともセミロジーとしてプロットされ、y の正しいスケールでプロットされます。しかし、y2をlog10スケールで表示したくないので、変更します

[AX, H1, H2] = plotyy(x, y1, x, y2, 'semilogy', 'plot');

ただし、左右の y 軸では、目盛りは最小範囲と最大範囲のみを示し、その間の詳細はすべてなくなります。なぜですか?

4

2 に答える 2

2

これを試すことができます:

[AX, H1, H2] = plotyy(x, y1, x, y2, 'semilogy', 'plot');

% set yticks for the left axis 
set(AX(1), 'ytick', yourDesiredYticks1)
set(AX(1), 'box', 'off') % to remove corresponding yticks on the right side of the plot

% set yticks for the right axis
set(AX(2), 'ytick', yourDesiredYticks2)
set(AX(2), 'box', 'off')
于 2012-06-04T10:06:34.610 に答える
1

これを試して:

%# create some data resembling what you described
x = 1:100;
y1 = rand(size(x))*1e-1 + 1e-4;
y2 = rand(size(x))*10;

%# plot
hAx = plotyy(x,y1, x,y2, 'semilogy', 'semilogy');
set(hAx(2), 'YScale','linear')

スクリーンショット

于 2012-06-04T16:33:16.703 に答える