Re: max_value/min_value in the x-axis? [message #81012] |
Fri, 03 August 2012 05:12 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
John Coxon writes:
> Ah, I should have been more clear: I want the axes to remain the same
> (hence looking specifically for an equivalent to MAX_VALUE instead of
> just using this method).
Ah. Well, then something like this, I guess:
indices = Value_Locate(x, [minVal, maxVal])
cgPlot, x[indices[0]:indices[1]], y[indices[0]:indices[1]], $
XRange=[Min(x),Max(x)]
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: max_value/min_value in the x-axis? [message #81013 is a reply to message #81012] |
Fri, 03 August 2012 05:05  |
John Coxon
Messages: 15 Registered: February 2012
|
Junior Member |
|
|
On 03/08/2012 13:02, David Fanning wrote:
> John Coxon writes:
>
>> I want to plot something using the PLOT routine and I want to be able to
>> set max_value and min_value on the graph so that nothing above a certain
>> point is plotted. However, for various reasons, I'd quite like to do
>> this in the x-axis, and not the y-axis. I've Googled, but I can't find
>> an easy way to do this; I'm currently thinking that a where statement
>> might be my best bet, but does anyone have any alternative suggestions?
>
> Use the XRANGE keyword with XSTYLE set to 1.
Ah, I should have been more clear: I want the axes to remain the same
(hence looking specifically for an equivalent to MAX_VALUE instead of
just using this method).
--
John Coxon
http://www.chickensinenvelopes.net/
|
|
|
Re: max_value/min_value in the x-axis? [message #81014 is a reply to message #81013] |
Fri, 03 August 2012 05:02  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
John Coxon writes:
> I want to plot something using the PLOT routine and I want to be able to
> set max_value and min_value on the graph so that nothing above a certain
> point is plotted. However, for various reasons, I'd quite like to do
> this in the x-axis, and not the y-axis. I've Googled, but I can't find
> an easy way to do this; I'm currently thinking that a where statement
> might be my best bet, but does anyone have any alternative suggestions?
Use the XRANGE keyword with XSTYLE set to 1.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|