how can i use function of plots that i made inside subplot?
3 ビュー (過去 30 日間)
古いコメントを表示
i made this function that create a polar plot how can i use this in subplot, i tried this but it didn't work, it makes a mess.
0 件のコメント
採用された回答
Star Strider
2015 年 1 月 5 日
You can do polar plots in subplots:
x = linspace(0, 2*pi);
y1 = sin(x).^2;
y2 = cos(x).^2;
figure(1)
subplot(2,1,1)
polar(x, y1)
axis equal
subplot(2,1,2)
polar(x, y2)
axis equal
The problem is that your function creates a new figure each time.
2 件のコメント
Star Strider
2015 年 1 月 5 日
I’m not certain what you’re doing, but I would either create the subplots first and supply the axis handle to your function, see the documentation for Make Subplot Axes the Current Axes, or create the plot and then return the axis handle to the subplot Return Subplot Axes Handle. The first requires that you supply the axis handle as an input argument to your function. The second requires that you return it as output from your function.
I leave those decisions to you, since it’s your code.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Subplots についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!