[ncl-talk] Fwd: Re: Tick mark size in contour plots
Gabriele Arduini
Gabriele.Arduini at legi.grenoble-inp.fr
Fri May 8 12:05:06 MDT 2015
It works!
I have missed this point, now everything works fine and it is much
clearer, also for other plots.
Thank you for the help.
Gabriele
Le 2015-05-07 21:29, Mary Haley a écrit :
> The base plot, which is the first plot in the "overlay" call, is the
> one that's going to provide the tickmarks, and not the plot that's
> being overlaid.
>
> So, try setting the tmXXX resources inside the "create" block for the
> logLin plot:
>
> ll_dthdy_x = create "ll" logLinPlotClass wks
> "vpXF" : vpx
> "vpYF" : vpy
> "vpWidthF" : vpw
> "vpHeightF" : vph
> "trXMinF" : xmin_plot
> "trXMaxF" : xmax_plot
> "trYMinF" : ymin_plot
> "trYMaxF" : ymax_plot
> "tmYLLabelFontHeightF: : 0.015 ; or whatever value you
> want
> "tmXBLabelFontHeightF: : 0.015 ; or whatever value you
> want
> "pmTickMarkDisplayMode" : "always"
> end create
>
> --Mary
>
> On Tue, May 5, 2015 at 12:05 PM, Gabriele Arduini
> <Gabriele.Arduini at legi.grenoble-inp.fr> wrote:
>
>> I forgot to put in cc of my reply all the mailing-list.
>> Sorry, but It is my first mail on it!
>>
>> Gabriele
>>
>> -------- Message original --------
>> Objet: Re: [ncl-talk] Tick mark size in contour plots
>> Date: 2015-05-04 19:34
>> De: Gabriele Arduini <Gabriele.Arduini at legi.grenoble-inp.fr>
>> À: Mary Haley <haley at ucar.edu>
>>
>> Hello Mary,
>> thank you for the precious link, it will help a lot in the future!
>>
>> Regarding my problem, I have tried your test script and everything
>> work
>> fine.
>> Indeed, I am "linearizing" my plot in order to plot it in terrain
>> following coordinates (2D coordinates)
>> without any interpolation. I am wondering if it is the problem...
>> even
>> though I receive the error message
>> before the overlay. I have attached here the "plotting" part of the
>> code, if you need of further informations,
>> please tell me.
>>
>> Thank you in advance for the help,
>> Gabriele
>>
>> :*******************
>> ; PLOTTING SECTION::
>> :*******************
>>
>> res at gsnDraw = False ; do not
>> draw the plot
>> res at gsnFrame = False ; do not
>> advance the frame
>> res at tiYAxisString = "Height (m a.s.l.)"
>> res at tiXAxisString = "Cross-valley distance x (m)"
>> res at tmXBLabelFontHeightF = 0.04
>> res at tmYLLabelFontHeightF = 0.04
>>
>> ; Plotting parameters ::
>> time_plot = (start_h-14)*60+it
>> z_plot = 45
>> x_plot_in = (newdims(2)/2)
>> x_plot_end = x_plot_in + (3000 / dx_orig)
>>
> ;*********************************************************************************
>> ; DTHDY PLOT ::
>> opts_dthdy = res
>>
>> ;Label ::
>> opts_dthdy at lbLabelBarOn = True
>> opts_dthdy at lbOrientation = "Vertical"
>> opts_dthdy at pmLabelBarSide = "Right"
>> opts_dthdy at lbTitleOn = False
>>
>> ; Contour Resources
>> opts_dthdy at cnLinesOn = False
>> ; turn off the
>> contour lines
>> opts_dthdy at cnFillOn = True
>> opts_dthdy at cnLineLabelsOn = False
>>
>> opts_dthdy at cnLevelSelectionMode = "ManualLevels"
>> opts_dthdy at cnMinLevelValF = -1.
>> opts_dthdy at cnMaxLevelValF = 1.
>> ; set the
>> maximum contour level
>> opts_dthdy at cnLevelSpacingF = 0.05
>> ; set the
>> interval between contours
>>
>> ; Change aspect ratio ::
>> opts_dthdy at vpWidthF = 0.8
>> opts_dthdy at vpHeightF = 0.4
>>
>> ; Plot ::
>> opts_dthdy at tiMainString = "~F22~(a) ~F21~ 3D,
>> t = 300
>> min";+ime_plot
>> opts_dthdy at sfXArray =
>> xlat_vert(:z_plot,x_plot_in:x_plot_in + (x_plot/dx_orig))
>> opts_dthdy at sfYArray =
>> z_av(:z_plot,x_plot_in:x_plot_in
>> + (x_plot/dx_orig))
>> contour_dthdy_line_linear_x = gsn_csm_contour(wks,
>> dthdy_av(:z_plot, x_plot_in:x_plot_end), opts_dthdy)
>>
>> ;Linearize ::
>> getvalues contour_dthdy_line_linear_x
>> "vpXF" : vpx
>> "vpYF" : vpy
>> "vpWidthF" : vpw
>> "vpHeightF" : vph
>> "trXMinF" : xmin_plot
>> "trXMaxF" : xmax_plot
>> "trYMinF" : ymin_plot
>> "trYMaxF" : ymax_plot
>> end getvalues
>> ;
>> ;; now, we linearize the plot!
>> setvalues contour_dthdy_line_linear_x
>> "trGridType" : "curvilinear"
>> end setvalues
>> ;;
>> ll_dthdy_x = create "ll" logLinPlotClass wks
>> "vpXF" : vpx
>> "vpYF" : vpy
>> "vpWidthF" : vpw
>> "vpHeightF" : vph
>> "trXMinF" : xmin_plot
>> "trXMaxF" : xmax_plot
>> "trYMinF" : ymin_plot
>> "trYMaxF" : ymax_plot
>> "pmTickMarkDisplayMode" : "always"
>> end create
>> overlay(ll_dthdy_x, contour_dthdy_line_linear_x)
>>
>> Le 2015-04-29 19:57, Mary Haley a écrit :
>>> Hi Gabriele,
>>>
>>> First, a quick tip: if an NCL graphical resource is not behaving
>> as
>>> expected, then you can search for all of the application examples
>> that
>>> use that resource by going to the applications page:
>>>
>>> http://www.ncl.ucar.edu/Applications/ [1] [2]
>>>
>>> Click on the word "resources" in the sentence at the top:
>>>
>>> [List of tips [3], resources [4], functions/procedures [5] and
>> the
>>> example scripts they appear in.]
>>>
>>> Wait for the page to load, and you will get a giant alphabetical
>> list
>>> of resources and all the examples they appear in.
>>> Here's a direct link:
>>>
>>>
>>
> http://www.ncl.ucar.edu/Applications/res_list.shtml#tmXBLabelFontHeightF
>> [2]
>>> [6]
>>>
>>> Back to your problem:
>>>
>>> When you get a message about "yyyyy is not not a resource in xxxx
>> at
>>> this time", then you first do two things:
>>>
>>> * Double-check that you've spelled the resource name
>> correctly.
>>>
>>> * Make sure you're applying it to a function that
>> recognizes it. For
>>> example, you can't set "xyLineColor" when calling
>> gsn_csm_contour.
>>>
>>> In your case, it seems like you are spelling it correctly, and
>>> gsn_csm_contour should accept both of those resources, so there
>> must
>>> be something else going on.
>>>
>>> Can you try the attached script to make sure it works? Also,
>> can you
>>> provide your script?
>>>
>>> --Mary
>>>
>>> On Wed, Apr 29, 2015 at 3:56 AM, Gabriele Arduini
>>> <gabriele.arduini at legi.grenoble-inp.fr> wrote:
>>>
>>>> Dear ncl-talk users,
>>>>
>>>> I have a problem to set the size of the tick marks in my
>> contours
>>>> plot.
>>>> Looking on the resources page on the website, I am trying to use
>>>> the
>>>> following resources::
>>>>
>>>> tmYLLabelFontHeightF , tmXBLabelFontHeightF
>>>>
>>>> but I receive back the message during the execution:
>>>> warning:tmXBLabelFontHeightF is not a valid resource in
>>>> cr_sect_3x_thyadv_vect_av_300_contour.PlotManager at this time
>>>> warning:tmYLLabelFontHeightF is not a valid resource in
>>>> cr_sect_3x_thyadv_vect_av_300_contour.PlotManager at this time
>>>>
>>>> The contour function I am using is the ** gsn_csm_contour **.
>>>> Should I use different resources to set the tick mark size in
>>>> contour
>>>> plots?
>>>>
>>>> Thank you in advance for the help.
>>>>
>>>> Regards,
>>>> Gabriele Arduini
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk [3] [1]
>>>
>>>
>>>
>>> Links:
>>> ------
>>> [1] http://mailman.ucar.edu/mailman/listinfo/ncl-talk [3]
>>> [2] http://www.ncl.ucar.edu/Applications/ [1]
>>> [3] http://www.ncl.ucar.edu/Applications/concepts_list.shtml [4]
>>> [4] http://www.ncl.ucar.edu/Applications/res_list.shtml [5]
>>> [5] http://www.ncl.ucar.edu/Applications/func_list.shtml [6]
>>> [6]
>>>
>>
> http://www.ncl.ucar.edu/Applications/res_list.shtml#tmXBLabelFontHeightF
>> [2]
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk [3]
>
>
>
> Links:
> ------
> [1] http://www.ncl.ucar.edu/Applications/
> [2]
> http://www.ncl.ucar.edu/Applications/res_list.shtml#tmXBLabelFontHeightF
> [3] http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> [4] http://www.ncl.ucar.edu/Applications/concepts_list.shtml
> [5] http://www.ncl.ucar.edu/Applications/res_list.shtml
> [6] http://www.ncl.ucar.edu/Applications/func_list.shtml
More information about the ncl-talk
mailing list