comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » cgWindRose has error producing legend?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
cgWindRose has error producing legend? [message #89472] Mon, 20 October 2014 09:59 Go to next message
BLesht is currently offline  BLesht
Messages: 89
Registered: March 2007
Member
Hi - I am using cgWindRose for a little exploratory work. My input data are straightforward, hourly observations from a NDBC buoy. I just remove the missing data and call cgWindRose:
;
good = WHERE(wd NE 99.00, ngood) ; Missing wind data have value 99.00
cgWindRose, wspd[good], wd[good], TITLE = buoyName+STRING(year, FORMAT='(I5)')
;
I do get a wind rose, but two things are strange. First, it looks like the rose isn't sized correctly for the window - the "East" label is cut off - and second, I get a legend heading "Wind Speed (m/s") but no legend with the error message:

Traceback Report from CGLEGENDITEM::INIT:

% CGLEGENDITEM::INIT: Number of COLORS elements not equal to the number of legend items.
% Execution halted at: CGLEGENDITEM::INIT 234 /Users/blesht/IDLStuff/coyote/cglegenditem__define.pro
% CGLEGEND 200 /Users/blesht/IDLStuff/coyote/cglegend.pro
% CGWINDROSE 363 /Users/blesht/IDLStuff/coyote/cgwindrose.pro
% LSUP_WIND_STRESS 35 /Users/blesht/IDLWorkspace82/Default/lsup_wind_stress.pro
% $MAIN$

I'm running IDL8.2.3 on MacOSX10.8.5 and my Coyote library is current through revision 1494. I don't have any other graphics calls (e.g. color tables, etc.) before the call to cgWindRose.

I haven't seen any other posts reporting this (or any other issues with cgWindRose), so I'm probably doing something wrong, but I haven't figured out what it could be. Any help much appreciated.

Thanks, Barry
Re: cgWindRose has error producing legend? [message #89476 is a reply to message #89472] Mon, 20 October 2014 12:20 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Barry Lesht writes:

> observations from a NDBC buoy. I just remove the missing data and call cgWindRose:
> ;
> good = WHERE(wd NE 99.00, ngood) ; Missing wind data have value 99.00
> cgWindRose, wspd[good], wd[good], TITLE = buoyName+STRING(year, FORMAT='(I5)')
> ;
> I do get a wind rose, but two things are strange. First, it looks like the rose isn't sized correctly for the window - the "East" label is cut off - and second, I get a legend heading "Wind Speed (m/s") but no legend with the error message:
>
> Traceback Report from CGLEGENDITEM::INIT:
>
> % CGLEGENDITEM::INIT: Number of COLORS elements not equal to the number of legend items.
> % Execution halted at: CGLEGENDITEM::INIT 234 /Users/blesht/IDLStuff/coyote/cglegenditem__define.pro
> % CGLEGEND 200 /Users/blesht/IDLStuff/coyote/cglegend.pro
> % CGWINDROSE 363 /Users/blesht/IDLStuff/coyote/cgwindrose.pro
> % LSUP_WIND_STRESS 35 /Users/blesht/IDLWorkspace82/Default/lsup_wind_stress.pro
> % $MAIN$
>
> I'm running IDL8.2.3 on MacOSX10.8.5 and my Coyote library is current through revision 1494. I don't have any other graphics calls (e.g. color tables, etc.) before the call to cgWindRose.
>
> I haven't seen any other posts reporting this (or any other issues with cgWindRose), so I'm probably doing something wrong, but I haven't figured out what it could be. Any help much appreciated.

Don't know. When I tried to run the example WindowRose program in the
Coyote Gallery, I had some problems. First, it was calling a retired
Coyote Library routine, and then it was having problems with cgPlotS.
Plus, the link in the internal documentation was wrong.

I have had a few problems with cgPlotS, since I modified it 10 October
to allow a vector of symbol types. I really didn't fully appreciate the
number of strange ways PlotS could be called! So, more effort to fix
these problems.

I didn't see anything like the problems you report, though. :-)

I guess I would get these two new programs and see if anything anything
changes for you. If not, we can go from there.

http://www.idlcoyote.com/programs/cgwindrose.pro
http://www.idlcoyote.com/programs/cgplots.pro

The windrose example code can be found here:

http://www.idlcoyote.com/gallery/windrose.zip

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgWindRose has error producing legend? [message #89486 is a reply to message #89472] Mon, 20 October 2014 18:39 Go to previous messageGo to next message
BLesht is currently offline  BLesht
Messages: 89
Registered: March 2007
Member
Well, that's pretty strange. I substituted the new versions of cgWindRose.pro and cgPlotS.pro for the old ones and ran my code. There was no difference in output; the right side ("East") is still cut off and I get the same error message about the legend colors. However, when I run the example code, it works fine.

So what's different? The only thing I see is that the example uses a SAM file as input and I pass the wind speed and direction arrays directly. I'll play with it for a bit more.

Oh, by the way, the link to the example code should be

http://www.idlcoyote.com/gallery/windrose_plot.zip
Re: cgWindRose has error producing legend? [message #89487 is a reply to message #89472] Mon, 20 October 2014 18:52 Go to previous message
BLesht is currently offline  BLesht
Messages: 89
Registered: March 2007
Member
OK - found the problem (silly operator error on my part). My test for missing values was wrong (I'm too embarrassed to explain why) but when I fixed it, the plot looks fine. Sorry - :-(
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: cgimage not generating output with cgps_open and cgps_close (fine in X window) .
Next Topic: strange GT and LT behavior

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:37:33 PDT 2025

Total time taken to generate the page: 0.00604 seconds