Re: NCL 5.1.1 Font problems

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Jun 18 2010 - 08:17:52 MDT

Hi Arnold,

Thanks for sending the images. This really helps.

------------------

First, I noticed you have times-roman fonts. It looks better if you use helvetica.
If you have a ".hluresfile" in your home directory, you can configure all of your
fonts to be helvetica easily. For more information, see:

http://www.ncl.ucar.edu/Document/Graphics/hlures.shtml

------------------

Second, I noticed that your "90oW" label on the rightmost plot is falling
off the edge. This may again be due to the fact your plots are not the same size.

In the gsn_panel call, you can force the rightmost plots to be a little further
to the left by setting the gsnPanelXF resource. See example 19 at:

http://www.ncl.ucar.edu/Applications/panel.shtml#ex19

for more information.

--------------------

The original issue is that you are paneling plots that are not the
same size. Your leftmost plots have tickmarks, and your rightmost plots don't.

The "60oN" label at the top of your left Y axis actually goes slightly above the
top Y axis line, which causes any titles above it to be automatically adjusted a
little higher. This is why the labels are higher on the leftmost plots than
they are on the rightmost plots.

I think the easiest thing to do is "fake" NCL out and make it think it has labels on the left axis
on the rightmost plots. You can do this by going ahead and drawing the labels did you did
for the lefmost plots, but draw them in white so you can't see them:

    res@tmYLLabelFontColor = "white"

Let me know if this doesn't work.

--Mary

On Jun 17, 2010, at 8:29 PM, <Arnold.Sullivan@csiro.au> <Arnold.Sullivan@csiro.au> wrote:

> Hi Mary,
>
> Thanks for your reply. Attached with two plot one both using same codes but only mpMinLatF and mpMaxLatF are different. As you could see that the labels are in different height.
>
> Cheers,
>
> Arnold
>
> From: Mary Haley [mailto:haley@ucar.edu]
> Sent: Friday, 18 June 2010 1:34 AM
> To: Sullivan, Arnold (CMAR, Aspendale)
> Cc: ncl-talk@ucar.edu
> Subject: Re: NCL 5.1.1 Font problems
>
>
> On Jun 16, 2010, at 6:49 PM, <Arnold.Sullivan@csiro.au> <Arnold.Sullivan@csiro.au> wrote:
>
>> Dear all,
>>
>> 1st problem:
>>
>> Try to generate 2 by 2 panel plot:
>>
>> plot = new(4, graphic)
>> ...............
>> res@mpMinLonF = 0. ; select a subregion
>> res@mpMaxLonF = 360.
>> res@mpMinLatF = -70.
>> res@mpMaxLatF = 70.
>> ................
>> res@gsnLeftString = "a) DJF,"
>> res@gsnLeftString = "b) DJF,"
>> res@gsnLeftString = "c) DJF,"
>> res@gsnLeftString = "d) DJF,"
>> ................
>> gsn_panel(wks,plot,(/2,2/),res_P) ; now draw as right panel.
>> If I use such code the plot looks ok. However, if I change MinLatF and MaxLatF to -60 and 60, a) and c) string possition will be higher then b) and d).
>
> Hi Arnold,
>
> I'm afraid I don't have enough information to go on here. Can you provide an image that shows the two different versions?
>
> The only thing that I can think of is that when you change the limits of your plot, this changes the size of your plot, and
> in turn, the titles may have to be shrunk in order to stay with the plot.
>
> Also, if your four plots do not have the exact same plot limits, this can cause differences in your titles. If I can
> see the images, then I might know better how to fix it.
>
>>
>>
>> 2nd problem:
>>
>> Similar plot but 3 by 4 panel plot:
>>
>> ; ===============================
>> ; overlay plots
>> ; ===============================
>>
>> res_L@tmYLLabelsOn = True
>> res_L@gsnLeftStringParallelPosF = 0 ; move this string left or right
>> res_L@gsnLeftStringOrthogonalPosF = .05 ; move this string up or down
>> res_L@gsnLeftString = "a) DJF cor. b/t 21st TPC & 20th IOD tele"
>> plot_L(0) = gsn_csm_contour_map_overlay(wks,CORREL(0,:,:), CORREL(0,:,:), res_L, res_cor)
>> res_L@gsnLeftString = "b) DJF cor. b/t 21st TPC & 20th IOD reg."
>> plot_L(1) = gsn_csm_contour_map_overlay(wks,SLOPE(0,:,:), SLOPE(0,:,:), res_L, res_cor)
>> res_L@tmXBLabelsOn = True
>> res_L@gsnLeftString = "c) DJF cor. b/t 21st TPC & 20th IOD SNR."
>> plot_L(2) = gsn_csm_contour_map_overlay(wks,STONR(0,:,:), STONR(0,:,:), res_L, res_cor)
>>
>> ; ======================
>> ; Center Left
>> ; ======================
>>
>> res_CL@gsnLeftStringParallelPosF = 0 ; move this string left or right
>> res_CL@gsnLeftStringOrthogonalPosF = .05 ; move this string up or down
>> res_CL@gsnLeftString = "d) MAM cor. b/t 21st TPC & 20th IOD tele."
>> plot_CL(0) = gsn_csm_contour_map_overlay(wks,CORREL(1,:,:),CORREL(1,:,:), res_CL, res_cor)
>> res_CL@gsnLeftString = "e) MAM cor. b/t 21st TPC & 20th IOD reg."
>> plot_CL(1) = gsn_csm_contour_map_overlay(wks,SLOPE(1,:,:),SLOPE(1,:,:), res_CL, res_cor)
>> res_CL@tmXBLabelsOn = True
>> res_CL@gsnLeftString = "f) MAM cor. b/t 21st TPC & 20th IOD SNR."
>> plot_CL(2) = gsn_csm_contour_map_overlay(wks,STONR(1,:,:),STONR(1,:,:), res_CL, res_cor)
>>
>> ; ======================
>> ; Center Right
>> ; ======================
>>
>> res_CR@gsnLeftStringParallelPosF = 0 ; move this string left or right
>> res_CR@gsnLeftStringOrthogonalPosF = .05 ; move this string up or down
>> res_CR@gsnLeftString = "g) JJA cor. b/t 21st TPC & 20th IOD tele."
>> plot_CR(0) = gsn_csm_contour_map_overlay(wks,CORREL(2,:,:),CORREL(2,:,:), res_CR, res_cor)
>> res_CR@gsnLeftString = "h) JJA cor. b/t 21st TPC & 20th IOD reg."
>> plot_CR(1) = gsn_csm_contour_map_overlay(wks,SLOPE(2,:,:),SLOPE(2,:,:), res_CR, res_cor)
>> res_CR@tmXBLabelsOn = True
>> res_CR@gsnLeftString = "i) JJA cor. b/t 21st TPC & 20th IOD SNR."
>> plot_CR(2) = gsn_csm_contour_map_overlay(wks,STONR(2,:,:),STONR(2,:,:), res_CR, res_cor)
>>
>> ; ======================
>> ; Right
>> ; ======================
>>
>> res_R@gsnLeftStringParallelPosF = 0 ; move this string left or right
>> res_R@gsnLeftStringOrthogonalPosF = .05 ; move this string up or down
>> res_R@gsnLeftString = "i) SON cor. b/t 21st TPC & 20th IOD tele."
>> plot_R(0) = gsn_csm_contour_map_overlay(wks,CORREL(3,:,:),CORREL(3,:,:), res_R, res_cor)
>> res_R@gsnLeftString = "j) SON cor. b/t 21st TPC & 20th IOD reg."
>> plot_R(1) = gsn_csm_contour_map_overlay(wks,SLOPE(3,:,:),SLOPE(3,:,:), res_R, res_cor)
>> res_R@tmXBLabelsOn = True
>> res_R@gsnLeftString = "l) SON cor. b/t 21st TPC & 20th IOD SNR."
>> plot_R(2) = gsn_csm_contour_map_overlay(wks,STONR(3,:,:),STONR(3,:,:), res_R, res_cor)
>>
>> If I change "a) DJF cor. b/t 21st TPC & 20th IOD tele" to "a) DJF cor. b/t 21st TPC & 20th IOD tele." then won't plot that panel and get error message:
>
> I think here you might be running into a problem with the length of your title relative to the size of your
> plot. In this case, seeing an image will help, but I may need to follow up after that by asking for your data
> and full script.
>
> Thanks,
>
> --Mary
>
>>
>> fatal:MapV40DHDrawMapList: ARPRAM - ALGORITHM FAILURE
>> fatal:PlotManagerDraw: error in plot draw
>> fatal:_NhlPlotManagerDraw: Draw error
>> Regards,
>> Arnold Sullivan
>> Scientist Support
>> CSIRO Marine & Atmospheric Research
>> Ph: 61 03 9239 4525
>> Fax: 61 03 9239 4444
>> Email: arnold.sullivan@csiro.au
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> <plot_panels_good.png><plot_panels.png>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 18 08:18:01 2010

This archive was generated by hypermail 2.1.8 : Thu Jun 24 2010 - 14:10:27 MDT