[ncl-talk] 2nd axis with Boxplot

Adam Phillips asphilli at ucar.edu
Wed Dec 4 14:34:52 MST 2019


Hi Frank,
Thank you f
Your script was most of the way there, it just needed a few extra resources
and a resizing of the plot as it was running off of the right hand side of
the page.
You had res/res2 at vpWidthF set to .85 and vpXF set to .15, which resulted in
the plot running from .15->1.05 in x-axis NDC space. (The valid NDC range
is 0-1.)

I changed the res/res2 at vpWidthF = .75, set res2 at tmYLOn = False, set
res2 at tmYLLabelsOn = False, and all looks good to me.
I have attached a modified version of your script and the resulting image.
Adam

On Wed, Dec 4, 2019 at 1:00 AM Kreienkamp Frank <Frank.Kreienkamp at dwd.de>
wrote:

> Hello Adam,
>
> yes the path leads to the target. Thanks
>
> But I have the problem to shift the 2. axis (new, res2@) to the right
> side of the Box plot. What is wrong in the script?
>
> Thanks in advance
> Frank
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Adam Phillips <asphilli at ucar.edu>
> Gesendet: Montag, 2. Dezember 2019 22:36
> An: Kreienkamp Frank <Frank.Kreienkamp at dwd.de>
> Cc: ncl-talk at ucar.edu
> Betreff: Re: [ncl-talk] 2nd axis with Boxplot
>
> Hi Frank,
> No there is not. However, you could use the vpXF/vpYF/vpWidthF/vpHeightF
> resources to set exactly where you want the boxplot to be drawn, and then
> specify the same resources, turn off all borders/tickmarks/labels except
> the Y-Axis, create a blank plot using gsn_csm_blank_plot, and draw one on
> top of another:
>
> https://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_csm_blank_plot.shtml
>
>
> Tick mark example #11 is similar, but overlays one plot on another using
> the overlay procedure.
> http://www.ncl.ucar.edu/Applications/tickmarks.shtml#ex11
>
> You will not want to use overlay, but you will want to set gsnDraw = True
> (=default) and gsnFrame = False in both resource lists.
>
> bres = True   ; boxplot resource list
> bres at gsnFrame = False
> bres at vpXF = 0.2
> bres at vpYF = 0.8
> ...
> plot = boxplot(....
>
> res = True   ; blank plot resource list
> res at gsnFrame = False
> res at tmYUseLeft = False
> res at tmYROn = False
> res at tmYRLabelsOn = False
> res at tmXBOn = False
> res at tmXBLabelsOn = False
> ...    ; other tm resources may be needed.
> res at trYMinF = ..
> res at trYMaxF = ..
> res at tmYLMode = "Explicit"
> res at tmYLValues = (/.../)
> res at tmYLLabels = (/.../)
>
> bplot = gsn_csm_blank_plot(...
> frame(wks)
>
> Hope that gets you going in the right direction!
> Adam
>
> On Mon, Dec 2, 2019 at 1:56 AM Kreienkamp Frank via ncl-talk <
> ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu> > wrote:
>
>
>         Hello,
>
>
>
>         is there a function to have a 2nd y-axis with boxplots? Something
> like gsn_csm_xy2
>
>
>
>         Thanks in advance
>
>         Frank
>
>
>
>
>
>
>
>         _______________________________________________
>         ncl-talk mailing list
>         ncl-talk at ucar.edu <mailto: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/ <http://www.cgd.ucar.edu/staff/asphilli/>
>   303-497-1726
>
>
> <http://www.cgd.ucar.edu/staff/asphilli>
>


-- 
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/20191204/a1be629b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test-2Achsen.png
Type: image/png
Size: 77745 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191204/a1be629b/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test-2Achsen.a.ncl
Type: text/x-ncl
Size: 7228 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191204/a1be629b/attachment.bin>


More information about the ncl-talk mailing list