can not subplot wind rose

I have to plot 3 pictures on one sheet, I do:
subplot(1,3,1)
contourf(piture 1)
subplot(1,3,2)
contourf(piture 2)
subplot(1,3,3)
wind_rose(dir,spd)
But result is wrong (like Matlab does not understand the 3-rd subplot and plots it separated on above the other subplots):
How to get that? Please help!

1 件のコメント

Sean de Wolski
Sean de Wolski 2012 年 3 月 15 日
What is wind_rose? Does it specify an axes somewhere in its first few lines?

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 3 月 15 日

1 投票

The documentation for which says,
-ax, to place wind rose on pervious axes, the input for ax
must be [theax x y width], where theax is the previous
axes, x and y are the location and width is the wind
rose width relative to theax width (default=1/5)
-parent, by default a new axes is created unless parent is
given, ex, parent may be a subplot
This suggests to me that the appropriate call Zach wants would be
wind_rose(dir,spd, '-parent', gca)

8 件のコメント

Sean de Wolski
Sean de Wolski 2012 年 3 月 15 日
or ...'parent',subplot(1,3,3))
Zach
Zach 2012 年 3 月 15 日
編集済み: Walter Roberson 2017 年 7 月 24 日
Thank you!
wind_rose(dir,spd, 'parent', subplot(1,3,3))
P.S.
How could I enlarge all 3 subplots and make less distance between subplots?
Sean de Wolski
Sean de Wolski 2012 年 3 月 15 日
Change their 'position' and 'outerposition' property
João Paulo Ferreira
João Paulo Ferreira 2017 年 7 月 24 日
This parameter: 'parent', subplot(1,3,3) --> it work perfectly in Matlab version 2013, but not in version 2015. Does anyone know if they have another method? This a message error:
_"Conversion to logical from matlab.graphics.axis.Axes is not possible.
Error in wind_rose (line 250) if parent"_
Thanks!!
Walter Roberson
Walter Roberson 2017 年 7 月 24 日
In the code for wind_row change
if parent
to
if parent ~= 0
João Paulo Ferreira
João Paulo Ferreira 2017 年 7 月 24 日
Perfect Walter!
Thank you very much!
João Paulo Ferreira
João Paulo Ferreira 2017 年 7 月 26 日
Walter, is it possible to record the rose in .PNG with the white background to transparent? I usually record the figure with the command below, but I do not know how to leave the background transparent.
set(gcf,'PaperUnits','centimeters','PaperPosition',[0 0 30 20]); % A4 maximized landscape
print('-dpng',fullfile(fname,filename),'-r300'); % 300 are the DPI
Thanks if you can help.
Walter Roberson
Walter Roberson 2017 年 7 月 26 日
If I recall, export_fig from the File Exchange can handle transparency in PNG. This corresponds logically to doing a screen grab of the figure and setting the Alpha or the Transparency https://www.mathworks.com/help/matlab/ref/imwrite.html#input_argument_d0e485690 properties . You can thus do the same thing by using
cdata = print('-RGBImage', '-r300');
and then imwrite() cdata to the file specifying 'Transparency' and the RGB value of the background color you wish to make transparent.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangePolar Plots についてさらに検索

質問済み:

2012 年 3 月 15 日

コメント済み:

2017 年 7 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by