Re: changing aspect ratio of the XY plot

From: Ufuk Utku Turuncoglu (BE) <u.utku.turuncoglu_at_nyahnyahspammersnyahnyah>
Date: Thu Feb 02 2012 - 03:27:41 MST

Hi Mary,

Thanks for helping with this issue. I tried your code and my script
creates following information at the end,

(0) vpw/vph = 0.894878/0.406763
(0) vpw/vph should be 0.55/0.25

I think that the problem is in the "gsn_attach_plots" because when i
remove the second plot and also attaching them, my code also works and
the output is,

(0) vpw/vph = 0.55/0.25
(0) vpw/vph should be 0.55/0.25

You think that the problem could be in the second plot but i change the
order and when i try to plot only second one it also works without any
problem. So, "gsn_attach_plots" might be source of the problem. What do
you think?

Regards,

--ufuk

On 2/1/12 9:16 PM, Mary Haley wrote:
> Hi Ufuk,
>
> Thanks for providing the data.
>
> I couldn't reproduce your problem. I narrowed down your script to just the graphics calls, and got the attached plot, which looks like it is the size you specified: 0.55 x 0.35.
>
> Remember that the vpWidthF and vpHeightF resources, in the case of an XY plot, a contour plot, or any plot that has an axis system, represents the width and height of the plot from axis to axis, and *not*, the width and height that encloses all the extra elements, like the outward pointing tickmarks and labels.
>
> Please see the attached PDF and reduced script. I added a call to "drawNDCGrid" so you can see that the the width and height are 0.55 and 0.35. Also, I did a "getvalues" to retrieve these two resource to further verify their values.
>
> Let me know if you are not getting the same results.
>
> --Mary
>
>
>
>
> On Jan 31, 2012, at 2:37 AM, Ufuk Utku Turuncoglu (BE) wrote:
>
>> Hi Mary,
>>
>> You can find the data values as follows. I just add a print statement just before first plot.
>>
>> print(sprintf("%8.2f", xf)+" "+sprintf("%8.2f", y1on(id,:))+" "+sprintf("%8.2f", y1mn(id,:)))
>>
>> Regards,
>>
>> --ufuk
>>
>> On 1/30/12 5:11 PM, Mary Haley wrote:
>>> Can you write your xf, y1on, and y1mn values to a file so I can try running your script without all the other data files?
>>>
>>> --Mary
>>>
>>> On Jan 30, 2012, at 7:26 PM, Ufuk Utku Turuncoglu (BE) wrote:
>>>
>>>> Hi Mary,
>>>>
>>>> Thanks for your help. I try to run the following example and it seems
>>>> that it is working. I don't understand way it is not working in my case.
>>>> The .hluresfile file has default definition and there is no any special
>>>> definition in it.
>>>>
>>>> !=========================================
>>>> ! This is a sample .hluresfile. It should
>>>> ! go in your home directory.
>>>> !
>>>> ! Comments for ".res" files are preceded by a "!".
>>>> ! Remember quotations are not used in .res files.
>>>>
>>>> ! White background/black foreground
>>>> *wkForegroundColor : (/0.,0.,0./)
>>>> *wkBackgroundColor : (/1.,1.,1./)
>>>>
>>>> ! Have a favorite colormap that you use for everything? You can
>>>> ! make it your default here (note the name is NOT in quotes).
>>>> !
>>>> ! For all available color maps, see
>>>> ! http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml
>>>> ! *wkColorMap : rainbow+gray
>>>>
>>>> ! Font
>>>> *Font : helvetica
>>>>
>>>> ! Function Codes [Default is a colon]
>>>> *TextFuncCode : ~
>>>>
>>>> ! Make default X11 window larger (adjust as necessary)
>>>> *wkWidth : 800
>>>> *wkHeight : 800
>>>>
>>>> ! Increase the default (16mb) contour memory
>>>> ! For example, if you have gridded data that
>>>> ! is larger than 500 x 500, you may need this.
>>>> *wsMaximumSize: 32556688
>>>> !==========================================
>>>>
>>>> Regards,
>>>>
>>>> --ufuk
>>>>
>>>> On 1/30/12 3:15 PM, Mary Haley wrote:
>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>>>>
>>>>> begin
>>>>> y = sin(0.0628*ispan(0,100,1))
>>>>>
>>>>> wks = gsn_open_wks("x11","xy1a")
>>>>>
>>>>> res = True
>>>>> res@vpHeightF = 0.25
>>>>> res@vpWidthF = 0.55
>>>>> plot = gsn_csm_y(wks,y,res)
>>>>>
>>>>> res@vpHeightF = 0.1
>>>>> res@vpWidthF = 0.7
>>>>> plot = gsn_csm_y(wks,y,res)
>>>>>
>>>>> end
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>> <data.txt>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Feb 2 03:28:08 2012

This archive was generated by hypermail 2.1.8 : Mon Feb 06 2012 - 14:24:56 MST