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

Home » Public Forums » archive » Re: Plotting Graphs on Same Plot With Axes Rescaled To Include Largest Range
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: Plotting Graphs on Same Plot With Axes Rescaled To Include Largest Range [message #75990] Mon, 09 May 2011 12:34
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On May 9, 4:18 pm, Chris Williams <fam36boozl...@gmail.com> wrote:
> Is it possible to plot a set of 2D graphs on the same graph, with the
> x,y-axes being rescaled to include the entire graph for each overplot?
>
> The problem I am having is if I have two graphs, and the second graph
> has a larger range than the first graph, both graphs will be on the
> axes of the first graph instead of the second graph. This clips the
> first graph which I do not want.
>
> Using the /NOERASE keyword keeps ALL of the axes on a set of plot,
> instead of the one with the largest range of values.
>
> Ideally, I am looking for a keyword to automatically set the graph
> axes to the data set with the largest range of values. For example,
> when using gnuplot, if you "plot func1, func2, func3", gnuplot will
> draw all three graphs and put them on the scale of the one with the
> largest values, so that all of the functions can be seen.

With the iTools or (new) Graphics, that is the default behavior. With
direct graphics, it is impossible: once something is drawn to the
device, it stays there, and no information is preserved on how it was
made. You may think of direct graphics as a printer. Once something
goes there, you cannot take it back (though you can erase what is
there).
Re: Plotting Graphs on Same Plot With Axes Rescaled To Include Largest Range [message #75991 is a reply to message #75990] Mon, 09 May 2011 12:32 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Chris Williams writes:

> Is it possible to plot a set of 2D graphs on the same graph, with the
> x,y-axes being rescaled to include the entire graph for each overplot?
>
> The problem I am having is if I have two graphs, and the second graph
> has a larger range than the first graph, both graphs will be on the
> axes of the first graph instead of the second graph. This clips the
> first graph which I do not want.
>
> Using the /NOERASE keyword keeps ALL of the axes on a set of plot,
> instead of the one with the largest range of values.
>
> Ideally, I am looking for a keyword to automatically set the graph
> axes to the data set with the largest range of values. For example,
> when using gnuplot, if you "plot func1, func2, func3", gnuplot will
> draw all three graphs and put them on the scale of the one with the
> largest values, so that all of the functions can be seen.

minPlot = Min([data1,data2], Max=maxPlot)
cgPlot, data1, YRANGE=[minPlot, maxPlot]
cgPlot, data2, /Overplot

Similarly for the X values, if needed.

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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Plotting Graphs on Same Plot With Axes Rescaled To Include Largest Range
Next Topic: make_dll

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

Current Time: Wed Oct 08 19:34:00 PDT 2025

Total time taken to generate the page: 0.00205 seconds