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

Home » Public Forums » archive » Printing something on a plot
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Printing something on a plot [message #5631 is a reply to message #5512] Thu, 18 January 1996 00:00 Go to previous message
nhbkmich is currently offline  nhbkmich
Messages: 8
Registered: January 1996
Junior Member
Myron Brown (mbrown@olie.wvitcoe.wvnet.edu) wrote:
: I'm plotting a box of values (representing dielectrics)
: with SHADE_SURF and rotating it so that the view is
: directly overhead. I'm using a 16-level color pallete so
: that the differences in the values are distinct. I'd like
: to be able to print small numbers over the graph corresponding
: to the value at particular points. The graph would then
: display regions with similar value with that value printed on
: top of the graph. When I say "over" and "on top of", I mean
: that the numbers would be printed at the same place as the
: regions (not at the top of the window). I'm not sure if this
: is possible. Can someone help me?

: Myron.

: -----------------------------
: Myron Brown
: mbrown@olie.wvitcoe.wvnet.edu

Maybe you should use contour rather than shade_surf.
Let z be the nx*ny box of values, i.e. z=fltarr(nx,ny), xmin, xmax,ymin
and ymax the minimum and maximum values of your data coordinates.

Make coordinate vectors:
IDL> x=xmin+findgen(nx)/nx*(xmax-xmin)
IDL> y=ymin+findgen(ny)/ny*(ymax-ymin)

Create contour plot:
IDL> contour,z,x,y,/fill,nlevels=15

nlevels=15 enforces 15 equidistant contour levels, i.e. 16 regions.
You can put any text onto your plot by xyouts, which uses data coordinates
by default. For example, z(ix,iy) could be annotated by

IDL> xyouts,x(ix),y(iy),strtrim(string(z(ix,iy))),alignment=0.5

Michael Steffens
email: Michael.Steffens@mbox.muk.uni-hannover.de
[Message index]
 
Read Message
Read Message
Previous Topic: Specifying a line feed
Next Topic: linking with fortran routines compiled with -dalign

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

Current Time: Sat Oct 11 08:59:12 PDT 2025

Total time taken to generate the page: 2.40024 seconds