[ncl-talk] warning:TextItemInitialize: Cannot set x, y, width, and height
Mary Haley
haley at ucar.edu
Mon Sep 22 10:15:33 MDT 2014
Wenshan,
It is "dangerous" to have vpXXXX resources in your .hluresfile for the very
reason that you are seeing. This is going to set the height and width for
every single plot that you create, which may cause unexpected results.
I believe what's happening is that when you attach text to the top of the
plot, the gsn_xxxx scripts try to resize the plot slightly so that the
titles don't run off the page. The resizing is done with
vpHeightF/vpWidthF resources, which apparently can't be reset if you've
already set them for the plot (confusing, I know).
--Mary
On Mon, Sep 22, 2014 at 1:08 AM, Wenshan Wang <wenshanw at uci.edu> wrote:
> Hi Mary,
>
> Thank you very much for the following up.
> Sorry I forgot to forward the following email to you.
>
> To sum up, I have these two lines in my .hluresfile, which cause the
> problem:
> !- canvas size: ratio of plot
> *vpHeightF : 0.3
> *vpWidthF : 0.8
>
> Is there a way that I can keep these two lines in .hluresfile?
> Thank you~
>
> Best,
> Wenshan
>
> ------------------------------------------------------------------------------
> Graduate Student Researcher
> Earth System Science
> University of California, Irvine
>
> ---------- Forwarded message ----------
> From: Wenshan Wang <wenshanw at uci.edu>
> Date: Sat, Sep 6, 2014 at 4:52 AM
> Subject: Re: [ncl-talk] warning:TextItemInitialize: Cannot set x, y,
> width, and height
> To: Adam Phillips <asphilli at ucar.edu>
>
>
> To be clear, no matter what scripts are loaded at the top, if you include
> gsnLeftString in your resource list you get the following error correct?
>
> Yes. This is what happens on my computer.
>
> ===================================================================
> I found the problem!!!
>
> In my .hluresfile, I have these two lines:
> !- canvas size: ratio of plot
> *vpHeightF : 0.3
> *vpWidthF : 0.8
>
> It seems they are causing the problem. If I turn them off, there will be
> no warnings at all.
> It's OK. I can just turn them off and include these two settings in each
> ncl script.
>
> Best,
> Wenshan
>
> ------------------------------------------------------------------------------
> Graduate Student Researcher
> Earth System Science
> University of California, Irvine
>
>
> On Fri, Sep 5, 2014 at 1:43 PM, Adam Phillips <asphilli at ucar.edu> wrote:
>
>> Hi Wenshan,
>> (I have cc'd Mary Haley on this.)
>>
>> First off: Thank you for including a short script that illustrates the
>> problem on your end. That allows us to easily test things here.
>>
>> I just tested your script (moving contributed.ncl below the gsn*ncl
>> scripts) using v6.2.0 and v6.2.1 on a Linux machine here, and I see no such
>> error messages and gsnLeftString is correctly used and displayed.
>>
>> To be clear, no matter what scripts are loaded at the top, if you include
>> gsnLeftString in your resource list you get the following error correct?
>>
>> ; warning:TextItemInitialize: Cannot set x,y,width,and height when other
>> text attributes have been specified also, proceding with other text
>> attribute requests
>>
>> Mary: This is for NCL v6.2.0 and Ubuntu v14.04.
>>
>> Adam
>>
>>
>>
>>
>>
>>
>> On Fri, Sep 5, 2014 at 12:01 PM, Wenshan Wang <wenshanw at uci.edu> wrote:
>>
>>> Hi Adam,
>>>
>>> Thank you very much for the reply!
>>>
>>> I still have the warning even though:
>>> 1, move 'load contributed.ncl' below the other two
>>> 2, load only gsn_csm
>>> 3, load nothing
>>>
>>> I will get rid of it when I comment off res at gsnLeftString.
>>> But this resource is quite useful. I'd like to use it.
>>> Actually, it never happened before. Only after I updated NCL to 6.2.0
>>> and Ubuntu to 14.04.
>>>
>>> NCL downloading is working now. Thank you!
>>>
>>> Best,
>>> Wenshan
>>>
>>> ------------------------------------------------------------------------------
>>> Graduate Student Researcher
>>> Earth System Science
>>> University of California, Irvine
>>>
>>>
>>> On Fri, Sep 5, 2014 at 8:47 AM, Adam Phillips <asphilli at ucar.edu> wrote:
>>>
>>>> Hi Wenshan,
>>>> You are loading contributed.ncl before gsn_code.ncl and gsn_csm.ncl.
>>>> contributed.ncl should always get loaded after the gsn*.ncl scripts. Try
>>>> making that change and see if you continue to get the warning message.
>>>>
>>>> And thanks for letting us know about the Earth System Grid downloading
>>>> error. I believe it is being looked into...
>>>> Adam
>>>>
>>>>
>>>> On Thu, Sep 4, 2014 at 4:08 PM, Wenshan Wang <wenshanw at uci.edu> wrote:
>>>>
>>>>> *Hi NCL group and users~~~*
>>>>>
>>>>> *I get this warning recently with all my plots and have no idea what
>>>>> the cause is.*
>>>>>
>>>>> warning:TextItemInitialize: Cannot set x,y,width,and height when other
>>>>> text attributes have been specified also, proceding with other text
>>>>> attribute requests
>>>>>
>>>>> *Here is a simple script that can produce this msg:*
>>>>>
>>>>> ; Written by Wang Wenshan 2014-09-04 Thursday 14:37:05
>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>>>> ;*************************************************************
>>>>> ; warning:TextItemInitialize: Cannot set x,y,width,and height when
>>>>> other text attributes have been specified also, proceding with other text
>>>>> attribute requests
>>>>> ;************************************************************
>>>>> begin
>>>>> x = ispan(1,100,1)
>>>>> y = 0.1*x
>>>>>
>>>>> wks = gsn_open_wks ("x11","xy") ; open workstation
>>>>>
>>>>> res = True ; plot mods desired
>>>>> ;res at tiMainString = "Basic XY plot" ; add title
>>>>> ;res at gsnLeftString = "left"
>>>>> res at gsnRightString = "right"
>>>>>
>>>>> plot = gsn_csm_xy (wks,x,y,res) ; create plot
>>>>>
>>>>> print("done!")
>>>>> end
>>>>>
>>>>> *NCL version: 6.2.0*
>>>>> *System: Linux grele 3.13.0-34-generic #60-Ubuntu SMP Wed Aug 13
>>>>> 15:45:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux*
>>>>>
>>>>> *Thank you very much!*
>>>>>
>>>>> *BTW, there is a 404 Not Found Error when I tried to download NCL
>>>>> 6.2.1 from earthsystemgrid.*
>>>>>
>>>>> 404 Not Found
>>>>>
>>>>> The following file was not found:
>>>>>
>>>>> ncl_ncarg-6.2.1.Linux_Debian6.0_i686_nodap_gcc445.tar.gz
>>>>> If this file was part of a Archive Storage request, the file might
>>>>> have been removed from our cache. Please consider resubmitting your Archive
>>>>> Storage request.
>>>>>
>>>>>
>>>>>
>>>>> Best,
>>>>> Wenshan
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Graduate Student Researcher
>>>>> Earth System Science
>>>>> University of California, Irvine
>>>>>
>>>>> _______________________________________________
>>>>> ncl-talk mailing list
>>>>> List instructions, subscriber options, unsubscribe:
>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Adam Phillips
>>>> Associate Scientist, Climate and Global Dynamics Division, NCAR
>>>> www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
>>>>
>>>> <http://www.cgd.ucar.edu/staff/asphilli>
>>>>
>>>
>>>
>>
>>
>> --
>> Adam Phillips
>> Associate Scientist, Climate and Global Dynamics Division, 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/20140922/7ef783b1/attachment.html
More information about the ncl-talk
mailing list