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

Home » Public Forums » archive » cgText (or XYOUTS for that matter) simply not drawing anything.
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
cgText (or XYOUTS for that matter) simply not drawing anything. [message #87685] Sat, 22 February 2014 19:50 Go to next message
Balthasar Indermuehle is currently offline  Balthasar Indermuehle
Messages: 22
Registered: August 2012
Junior Member
Hi all,

I've been stumped by this for hours now. Not sure what I'm missing. Especially given this is code that works in another scenario just fine. So I have these large vectors of of lat/lon coordinates I'm plotting. I'm selecting the data according to some criteria, and by convention (my own) name the x and y of the current plots just that: x and y.

< data has been read into lat/lon and a few other variables>

;first we get rid of all data that is 0
sel_data = WHERE( lat ne 0, count)
all_lon = lon[sel_data]
all_lat = lat[sel_data]

sel_data = WHERE( lat ne 0 and vs gt 64, count)
x = lon[sel_data]
y = lat[sel_data]

after this, just so you know we have data:
IDL> help,lon
LON DOUBLE = Array[6634]
IDL> help,lat
LAT DOUBLE = Array[6634]
IDL> help,all_lon
ALL_LON DOUBLE = Array[2011]
IDL> help,all_lat
ALL_LAT DOUBLE = Array[2011]
IDL> help,x
X INT = Array[2011]
IDL> help,y
Y DOUBLE = Array[2011]

and lastly:

IDL> print,min(all_lat)
-33.960200
IDL> print,max(all_lat)
-33.317200
IDL> print,max(all_lon)
151.62650
IDL> print,min(all_lon)
151.00180

all looks sensible. Now let's move on:

cgPLOT, x, y, psym=1, POSITION=[0.1, 0.3, 0.7, 0.9], $
TITLE=source + " " + " Positions", /YNOZERO, YSTYLE=3, XSTYLE=3, YRANGE=[min(all_lat),max(all_lat)], XRANGE=[min(all_lon),max(all_lon)], $
XTITLE="Longitude [Deg]", YTITLE="Latitude [Deg]", SYMSIZE=1, color='blue'

This plots the plot as expected, with adequate ranges and position marks. But then I call this:

cgTEXT, -33.7, 151.3, 'RX', color='black'

The RX label never shows up. I also am unable to overplot any symbols using cgPlots. I wonder if maybe the coordinate system somehow got screwed up? But the edge labels show the correct range of lat/lon values for which both the text and plotting routing at position -33.7/151.3 should put those smack bang in the middle of the plot.

So this does not work either:

cgPLOTS, -33.879547, 151.188903, PSYM=4

What's the obvious thing my tired eyes can't see!?

Thanks

- Balt
Re: cgText (or XYOUTS for that matter) simply not drawing anything. [message #87687 is a reply to message #87685] Sat, 22 February 2014 21:39 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Balthasar Indermuehle writes:

> This plots the plot as expected, with adequate ranges and position marks. But then I call this:
>
> cgTEXT, -33.7, 151.3, 'RX', color='black'

Uh, think you want this.

cgTEXT, 151.3, -33.7, 'RX', Color-'black'

X, then Y. ;-)

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: cgText (or XYOUTS for that matter) simply not drawing anything. [message #87688 is a reply to message #87687] Sat, 22 February 2014 22:05 Go to previous message
Balthasar Indermuehle is currently offline  Balthasar Indermuehle
Messages: 22
Registered: August 2012
Junior Member
David, thank you! I don't know what to say, I blush from gratitude (and a little bit embarrassment)...

Cheers

- Balt
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL license file
Next Topic: The eventhandler Mechanism for basewidget.

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

Current Time: Wed Oct 08 13:51:40 PDT 2025

Total time taken to generate the page: 0.00495 seconds