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

Home » Public Forums » archive » Re: how to add mark for every points in each plot?
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
Re: how to add mark for every points in each plot? [message #10600] Wed, 07 January 1998 00:00
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
David Fanning wrote:
>
> hwang (hwang@umassd.edu) writes:
>
>> I have two arrays.Every array has 12 numbers.Each number stands for the
>> data for every month of some year.My boss want to plot these two
>> arrays(X versus Y) but he let me mark '1','2',......or
>> 'Jan','Feb'......besides every point in the plot.
[...]

[and David provides an example code using xyouts]

just a short addendum: if you want to label the points with numerical
values, you should use the string function (which includes a format
option). Then you would build a label string array like

valstr = string(y,format="(f7.2)")

and put that out as David suggested

xyouts,x,y,valstr,align=0.5

Martin.


------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
186 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
IDL-homepage: http://www-as.harvard.edu/people/staff/mgs/idl/
------------------------------------------------------------ -------
Re: how to add mark for every points in each plot? [message #10609 is a reply to message #10600] Tue, 06 January 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
hwang (hwang@umassd.edu) writes:

> I have two arrays.Every array has 12 numbers.Each number stands for the
> data for every month of some year.My boss want to plot these two
> arrays(X versus Y) but he let me mark '1','2',......or
> 'Jan','Feb'......besides every point in the plot. I try to find some
> parameters in the PLOT routine which can add such mark,but PLOT has no
> such parameter or function.I try to use OPLOT, in order to every time I
> call OPLOT,it only plot one point.But OPLOT or PLOT only accept the
> array arguments.How can I do? Is there any expert knowing how to do
> this?

Ahem, well, shucks. How about this?

seed = -2L
x = RandomU(seed, 12) * 95 + 2.5
y = RandomU(seed, 12) * 95 + 2.5
Plot, x, y, PSym=2, SymSize=2
months = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', $
'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
XYOutS, x, y + 4, months, Alignment=0.5

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: problem with arrays of structures
Next Topic: Does TRIANGULATE return vertices in counter-clockwise order?

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

Current Time: Fri Oct 10 19:21:50 PDT 2025

Total time taken to generate the page: 0.16715 seconds