[ncl-talk] margin top of viewport?

Adam Phillips asphilli at ucar.edu
Thu Feb 21 09:41:44 MST 2019


Hello,
I would speculate that it has to do with the label bar, as in the labelbar
is counted as part of the plot height. Note the height of the plot itself
is not equal to 0.3. Try temporarily turning off first the labelbar title,
and then the entire labelbar and see if that corrects the issue. If it
does, you can always call gsn_labelbar_ndc (example of use  instead of
letting the plotting function handle the plotting.
gsn_labelbar_ndc documentation:
https://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_labelbar_ndc.shtml
Script that uses gsn_labelbar_ndc:
https://www.ncl.ucar.edu/Applications/Scripts/maponly_6.ncl

Hope that helps!
Adam


On Thu, Feb 21, 2019 at 7:03 AM MeteoBB <info at meteo-bb.de> wrote:

> Hi all,
>
> to get space in top of the plot i tried to set the viewport parameters
> manually in NDC.
>
> res at vpXF        = 0.2
> res at vpYF        = 0.8
> res at vpHeightF   = 0.3
> res at vpWidthF    = 0.3
>
> As you can see in die picture, the x-coordinate is correct (0.2).
> But the y coordinate of the viewport isn't 0.8 (it is 0.784).
> Why? Is that because of my lat/lon settings for the contour plot?
> Any ideas?
>
> Regards.
>
> Am 19.02.2019 um 05:49 schrieb Rick Brownrigg:
>
> Hi,
>
> I have to wonder if you might have better luck trying your annotations in
> NDC space. There are a number of functions named "gsn_XXX_ndc() that
> operate in this coordinate system. The function "drawNDCGrid()" can be
> helpful in understanding what's going on.
>
>     http://ncl.ucar.edu/Document/Functions/Shea_util/drawNDCGrid.shtml
>
> HTH...
> Rick
>
> On Mon, Feb 18, 2019 at 5:26 PM MeteoBB <info at meteo-bb.de> wrote:
>
>> Hi,
>>
>> i have a map with a countur plot and want to add above the map a box with
>> some infos (see the attached pic).
>> Drawing the box is no problem, but when i turn off the MainString, then
>> there is no area left to draw my box, because the
>> map is slipping up. Yes, i could leave the MainTitle empty. But this is
>> not satisfying.
>>
>> Tried setting:
>> *res at gsnBoxMargin = 0.05 *
>>
>> seems to be a good start. But is there a resource only for a margin-top?
>> Or do i have to set the viewport manually with *vpXF*,* vpYF*, *vpWidthF*,
>> *vpHeightF*?
>>
>> Thanks.
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190221/81f737d1/attachment.html>


More information about the ncl-talk mailing list