Re: X-Axis title in X-Log plot.

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu, 8 Nov 2007 15:35:04 -0700 (MST)

Yi,

The problem is that you are trying to panel two plots that are not the
same size. gsn_panel should only be used on two plots that are the
same or very close to the same size, otherwise you will get unexpected
results.

What's happening is your first plot is much larger than your second
one, and is pushing the second too close to the bottom of the unit
square that NCL draws in. Hence, you can't see the bottom label.

Instead of using gsn_panel, use the vpXXX resources to position and
resize the plots yourself. See example 20 at:

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

--Mary

On Thu, 8 Nov 2007, Wang, Yi wrote:

> Hi Mary:
>
> Thank you for your time. Yes, you are right. The code is right.
>
> However, see my attached code and plot. The plot has three frames. The last
> one indicates the issue.
>
> The issue comes in when doing panel.
>
> Not sure why?
>
> Thanks,
>
> Yi
>
>
> On 11/8/07 1:06 PM, "Mary Haley" <haley_at_ucar.edu> wrote:
>
>> Yi,
>>
>> Your code looks correct. I took your code, used the same resources
>> (except for gsnDraw and gsnFrame being se to False), and added some
>> dummy data. Can you try this and let me know if you still have a
>> problem:
>>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>
>> begin
>> wks = gsn_open_wks("x11","log")
>>
>> res1 = True
>> res1_at_tiMainString = "Frequency and Response"
>>
>> res1_at_trXMinF = 0.001
>> res1_at_trXMaxF = 0.5
>> res1_at_trYMinF = -0.2
>> res1_at_trYMaxF = 1.2
>> res1_at_trXLog = True
>> res1_at_trYLog = False
>> res1_at_tmXBMode = "Explicit" ; explicit labels
>> res1_at_tmXBValues = (/0.01,0.02,0.1/)
>> res1_at_tmXBLabels = (/"100","50","10"/)
>> res1_at_tiXAxisOn = True
>> res1_at_tiXAxisString = "Period (days)" ;;;tiXAxisString
>>
>> freq = fspan(0.001,0.5,30)
>> wts = random_uniform(-0.2,1.2,30)
>>
>> plot = gsn_csm_xy (wks,freq,wts,res1)
>> end
>>
>>
>> On Thu, 8 Nov 2007, Wang, Yi wrote:
>>
>>> Hi There:
>>>
>>> My code seems not willing to add X-Axis for a X-Log plot as below:
>>>
>>> res1 = True
>>> res1_at_gsnDraw = False
>>> res1_at_gsnFrame = False
>>> res1_at_tiMainString = "Frequency and Response"
>>>
>>> res1_at_trXMinF = 0.001
>>> res1_at_trXMaxF = 0.5
>>> res1_at_trYMinF = -0.2
>>> res1_at_trYMaxF = 1.2
>>> res1_at_trXLog = True
>>> res1_at_trYLog = False
>>> res1_at_tmXBMode = "Explicit" ; explicit labels
>>> res1_at_tmXBValues = (/0.01,0.02,0.1/)
>>> res1_at_tmXBLabels = (/"100","50","10"/)
>>> res1_at_tiXAxisOn = True
>>> res1_at_tiXAxisString = "Period (days)" ;;;tiXAxisString
>>>
>>> ; plot(1) = gsn_csm_xy (wks,wts_at_resp,wts_at_freq,res1)
>>> plot(1) = gsn_csm_xy (wks,freq,wts_at_resp,res1)
>>>
>>> How do I fix this?
>>>
>>> Thanks in advance,
>>>
>>> Yi
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk_at_ucar.edu
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>
> --
>
>
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 08 2007 - 15:35:04 MST

This archive was generated by hypermail 2.2.0 : Fri Nov 09 2007 - 09:36:39 MST