Re: I'm a beginner, IDL question plot, max_value [message #81802] |
Thu, 25 October 2012 16:06  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mati writes:
> I've got an ascii file with lots of rows and columns, I must select 2 columns,x and y,plot them and set max and min value to exclude bad data points.
> Here is what I've made(it works,but I don't know if it's the best way to do it):
>
> data=read_ascii('')
> x=data.field01[6,*]
> y=data.field01[14,*]
> plot,x,y,max_value=40,min_value=0
>
> the problem is: max_value and min_value gives extremes to pick up data only for y variable...how can I do to set also max_value and min_value for x???
You typically set the XRange keyword to change the x values
that are plotted on the plot. You have to be careful, though,
since IDL will "autoscale" the axes. This is sometimes what
you want and sometimes not. If you want to turn it off, you
also have to set the [XY]Style keywords:
cgPlot, x, y, XRANGE=[20,64], YRANGE=[0,40], XSTYLE=1, YSTYLE=1
Sometimes, it is easier to just do this interactively by
drawing a rubberband box around the part of the plot you
want to "zoom into":
cgZPlot, x, y
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
|
|
|