automatic resize of one graph using subplot function

1 回表示 (過去 30 日間)
Jonas
Jonas 2011 年 3 月 4 日
I have a m-file which is producing one plot graph and one polar graph.
In this file I attribute the plot graph to subplot(1,2,1) and the polar graph to subplot(1,2,2).
The problem is that while I do this my polar graph undergo an unexpected resize of the radius axis (in polar coordinates), increasing of about 30%, thus providing me with a non optimal graph.
I tried to use the axis command with the various arguments (image, ...), but it doesn't help.
anyone can help?

採用された回答

Paulo Silva
Paulo Silva 2011 年 3 月 4 日
x=0:0.1:10;
s1=subplot(121)
plot(x,sin(x))
s2=subplot(122)
plot(x,tan(x))
xlim(s1,[0 100]) %define your own x limits for subplot 1
ylim(s1,[-10 10]) %define your own y limits for subplot 1
%or you can use
axis(s1,[0 100 -1 1]) %same thing as xlim and ylim
get(s1) %this will show you some properties of suplot 1 that you can change
%for example change the tag
set(s1,'tag','mytag')

その他の回答 (1 件)

Brett Shoelson
Brett Shoelson 2011 年 3 月 4 日
Or you can just set the x- and (or) y-limits to be manual after you create your individual plots. (The default is 'automatic'.):
xlim('manual');
ylim('manual');
Cheers, Brett

カテゴリ

Help Center および File ExchangeAxes Appearance についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by