[ncl-talk] Using vp resources for panelling different sized WRF contour plots

Mary Haley haley at ucar.edu
Mon Aug 27 13:37:07 MDT 2018


I'm sure there must be a better way to do all of this, but you can try using
pmLabelBarParallelPosF
, which allows you to move the labelbar left or right.  See panel_21.ncl at:
http://www.ncl.ucar.edu/Applications/panel.shtml#ex21

which uses pmLabelBarOrthogonalPosF, but is the same idea.

On Fri, Aug 24, 2018 at 5:51 PM, Tabish Ansari <tabishumaransari at gmail.com>
wrote:

> Hi Mary,
>
> Thank you very much for the help - using setvalues after the plot creation
> finally worked!
> However, there's a new, slightly annoying issue : the common labelbar for
> the two plots within the panel isn't centered now.
> Since the right plot was resized, i.e., shrunk to the same height as the
> left plot, it seems that there quite a bit of white space
> within the right plot which is considered part of the plot and NCL is
> trying to center the common labelbar according to the
> original viewport width (not plot width) of both plots.
>
> I can get around this problem by slightly moving the vpXF position of the
> right plot to further right but I don't want too much
> gap between the plots just to center the labelbar.
>
> Is there any way to manually align the common labelbar in the panelplot?
> I just want to move it slightly towards the left.
>
> Thanks
>
> Tabish
>
> Tabish U Ansari
> PhD student, Lancaster Environment Center
> Lancaster Univeristy
> Bailrigg, Lancaster,
> LA1 4YW, United Kingdom
>
> On 24 August 2018 at 15:10, Mary Haley <haley at ucar.edu> wrote:
>
>> Hi Tabish,
>>
>> I haven't tried this with wrf_map_overlays, but I think if you want to
>> change the width and height, you need to do it using the second resource
>> list associated with wrf_map_overlays:
>>
>> mpres = True
>> mpres at vpHeightF = vph
>> plot(1) = wrf_map_overlays(c,wks,(/contour_d04/),pltres,mpres)
>>
>> If that doesn't work, then you could try setting the height after the
>> plot is created:
>>
>> plot(1) = wrf_map_overlays(c,wks,(/contour_d04/),pltres,False)
>> setvalues plot(1)
>>   "vpHeightF" : vph
>> end setvalues
>>
>> If that still doesn't work, then it would help if you could provide your
>> data file, which you can use our ftp for, if the file is not too large.
>> You can email me this information offline if you don't want to email the
>> whole group.
>>
>> http://www.ncl.ucar.edu/ftp_files.shtml
>>
>>
>> --Mary
>>
>>
>>
>>
>>
>>
>>
>> On Wed, Aug 22, 2018 at 10:07 AM, Tabish Ansari <
>> tabishumaransari at gmail.com> wrote:
>>
>>> Hi Mary,
>>>
>>> Thanks for your response.
>>> I tried to include the following lines in the panelplot script:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *plot = new(2,graphic)                          ; create a plot
>>> arrayplot(0) = wrf_map_overlays(a,wks,(/contour_d01/),pltres,mpres)  ; Plot
>>> the data over a map background;---Retrieve the height used for the first
>>> plot and apply to second plot  getvalues plot(0)    "vpHeightF" : vph  end
>>> getvalues  pltres at vpHeightF                   = vphplot(1) =
>>> wrf_map_overlays(c,wks,(/contour_d04/),pltres,False)  *
>>>
>>> However, it still plots them with different height.
>>>
>>> Does the wrf_map_overlays() function does not accept these resources?
>>>
>>> Thanks
>>>
>>> Tabish
>>> Tabish U Ansari
>>> PhD student, Lancaster Environment Center
>>> Lancaster Univeristy
>>> Bailrigg, Lancaster,
>>> LA1 4YW, United Kingdom
>>>
>>>
>>> On Mon, 20 Aug 2018 at 21:59, Mary Haley <haley at ucar.edu> wrote:
>>>
>>>> Dear Tabish,
>>>>
>>>> You might be able to still use gsn_panel with the different-sized plots.
>>>>
>>>> The key is creating the first plot, and then retrieving the height of
>>>> that plot and using it to set the height of the second plot. Then, when
>>>> gsn_panel goes to panel both plots, it should retain the heights relative
>>>> to each other.
>>>>
>>>> See the attached sample script, which only draws a map since I don't
>>>> have your dataset.
>>>>
>>>> You can use gsnPanelXF to tweak the X positions of the paneled plots if
>>>> you need to.
>>>>
>>>> --Mary
>>>>
>>>>
>>>> On Mon, Aug 20, 2018 at 9:56 AM, Tabish Ansari <
>>>> tabishumaransari at gmail.com> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> I want to panel two plots side by side but they're of different sizes.
>>>>> The panelplot routine in ncl does plot them but they remain of different
>>>>> heights. I want to use the vp resources to manually shrink them so that
>>>>> their height matches.
>>>>>
>>>>> I have attached 2 scripts: first one is working and uses the panelplot
>>>>> resource and creates the figure that is attached, second one uses vp
>>>>> resources but doesn't panel the two plots side by side.
>>>>>
>>>>> I'd really appreciate if you could point out what's wrong in the
>>>>> second script.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Tabish
>>>>>
>>>>>
>>>>> Tabish U Ansari
>>>>> PhD student, Lancaster Environment Center
>>>>> Lancaster Univeristy
>>>>> Bailrigg, Lancaster,
>>>>> LA1 4YW, United Kingdom
>>>>>
>>>>> _______________________________________________
>>>>> ncl-talk mailing list
>>>>> ncl-talk at ucar.edu
>>>>> List instructions, subscriber options, unsubscribe:
>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>
>>>>>
>>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180827/674003dc/attachment.html>


More information about the ncl-talk mailing list