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

Home » Public Forums » archive » Re: slightly shifted plots (?)
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: slightly shifted plots (?) [message #36988] Sun, 09 November 2003 01:59
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning wrote:

> R.G. Stockwell writes:
>
>> duh... i mean.. with the shift in the oplot ...... duh...
>> yshift = 1
>> OPlot, x, y2+yshift
>
> I'm pretty big on aesthetics, but I have to admit,
> manipulating the data so that it *looks better* gives
> me the willies. After my fairly flippant answer this
> morning, I think I would agree with JD. Look for
> more creative ways to present the *real* data,
> not sneaky ways to fix it. :-)
>
> Cheers,
>
> David
>

What is with an additional axis with small differences in the range?

Reimar



--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
Re: slightly shifted plots (?) [message #36991 is a reply to message #36988] Fri, 07 November 2003 19:26 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
R.G. Stockwell writes:

> duh... i mean.. with the shift in the oplot ...... duh...
> yshift = 1
> OPlot, x, y2+yshift

I'm pretty big on aesthetics, but I have to admit,
manipulating the data so that it *looks better* gives
me the willies. After my fairly flippant answer this
morning, I think I would agree with JD. Look for
more creative ways to present the *real* data,
not sneaky ways to fix it. :-)

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: slightly shifted plots (?) [message #36992 is a reply to message #36991] Fri, 07 November 2003 19:11 Go to previous message
R.G. Stockwell is currently offline  R.G. Stockwell
Messages: 363
Registered: July 1999
Senior Member
>
> Perhaps a shift in the y direction would be appropriate. :)
>
> y1 = Smooth( Randomu(-5L, 101), 10, /Edge_Truncate)
> y2 = y1 + Smooth( Randomu(-5L, 101), 10, /Edge_Truncate)/4
> x = Indgen(10)
> Plot, x, y1,yr=[min(y1) < min(y2),max(y1) > max(y2)]
> OPlot, x, y2

duh... i mean.. with the shift in the oplot ...... duh...
yshift = 1
OPlot, x, y2+yshift


> Cheers,
> bob
>
>
>
Re: slightly shifted plots (?) [message #36993 is a reply to message #36992] Fri, 07 November 2003 19:10 Go to previous message
R.G. Stockwell is currently offline  R.G. Stockwell
Messages: 363
Registered: July 1999
Senior Member
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.1a1561bcc6e365ca989735@news.frii.com...
> Antonio writes:
>
>> I was wondering whether there would be any routine that enable to
>> slightly shift two almost identical functions so that they do not
>> overlap in the same plot.
>
> How about something like this:
>
> y = Smooth( Randomu(-5L, 101), 10, /Edge_Truncate)
> x = Indgen(10
> Plot, x, y
> OPlot, x+1, y
>
> Cheers,
>
> David
> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155


Perhaps a shift in the y direction would be appropriate. :)

y1 = Smooth( Randomu(-5L, 101), 10, /Edge_Truncate)
y2 = y1 + Smooth( Randomu(-5L, 101), 10, /Edge_Truncate)/4
x = Indgen(10)
Plot, x, y1,yr=[min(y1) < min(y2),max(y1) > max(y2)]
OPlot, x, y2

Cheers,
bob
Re: slightly shifted plots (?) [message #36994 is a reply to message #36993] Fri, 07 November 2003 17:14 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Fri, 07 Nov 2003 04:25:18 -0700, Antonio wrote:

> hi all,
> I was wondering whether there would be any routine that enable to
> slightly shift two almost identical functions so that they do not
> overlap in the same plot.
> thanks, cheers!
> a.

The standard in astronomy is to add, say, 5 units to the data of one curve
and mention, e.g., "Curve #2 shifted by 5 units for clarity". If their
near equality is what's of interest, a ratio or difference plot might
prove more interesting.

JD
Re: slightly shifted plots (?) [message #36998 is a reply to message #36994] Fri, 07 November 2003 14:51 Go to previous message
mmiller3 is currently offline  mmiller3
Messages: 81
Registered: January 2002
Member
>>>> > "Antonio" == Antonio <angaspx@yahoo.it> writes:

> hi all, I was wondering whether there would be any routine
> that enable to slightly shift two almost identical
> functions so that they do not overlap in the same plot.
> thanks, cheers! a.

One method that can work well to separate overlapping data is to
add a small amount of random noise (jitter) to the data points as
they are plotted. This will tend to move overlapping values
apart on the plot, but does not affect calculations as it is only
added in the plot, not to the actual data. If the random noise
is small compared to the distribution of the data itself, then
the quality of the plot is not changed. This may not work for
calculations that don't include any noise though - it is hard to
add a small amount of 0...

Mike



P.S. For one implementation, see "jitter" from R
http://stat.ethz.ch/R-manual/R-patched/library/base/html/jit ter.html
http://www.r-project.org

Chambers, J. M., Cleveland, W. S., Kleiner, B. and Tukey, P.A.
(1983) _Graphical Methods for Data Analysis._ Wadsworth; figures
2.8, 4.22, 5.4.

Chambers, J. M. and Hastie, T. J. (1992) _Statistical Models in
S._ Wadsworth & Brooks/Cole.
Re: slightly shifted plots (?) [message #36999 is a reply to message #36998] Fri, 07 November 2003 13:25 Go to previous message
Pepijn Kenter is currently offline  Pepijn Kenter
Messages: 31
Registered: April 2002
Member
Antonio wrote:
> hi all,
> I was wondering whether there would be any routine that enable to
> slightly shift two almost identical functions so that they do not
> overlap in the same plot.
> thanks, cheers!
> a.

I would not approve of shifting the plot, you might suggest an effect
that is not present. If one line completely blocks the other then you
could use different linestyles.

You could also plot the difference or the ratio of the two lines to gain
more insight.

Pepijn Kenter.
Re: slightly shifted plots (?) [message #37003 is a reply to message #36999] Fri, 07 November 2003 12:34 Go to previous message
the_cacc is currently offline  the_cacc
Messages: 104
Registered: October 2001
Senior Member
angaspx@yahoo.it (Antonio) wrote in message news:<5d449dc5.0311070325.4d9a3d1d@posting.google.com>...
> hi all,
> I was wondering whether there would be any routine that enable to
> slightly shift two almost identical functions so that they do not
> overlap in the same plot.
> thanks, cheers!
> a.


You could try a log plot (alog10)? May show the differences more clearly.
Re: slightly shifted plots (?) [message #37005 is a reply to message #37003] Fri, 07 November 2003 07:01 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Antonio writes:

> I was wondering whether there would be any routine that enable to
> slightly shift two almost identical functions so that they do not
> overlap in the same plot.

How about something like this:

y = Smooth( Randomu(-5L, 101), 10, /Edge_Truncate)
x = Indgen(10
Plot, x, y
OPlot, x+1, y

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: how to write in HDF-EOS format?
Next Topic: Re: Is it possible to change the title of a WIDGET_SLIDER?

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

Current Time: Wed Oct 08 14:01:20 PDT 2025

Total time taken to generate the page: 0.00786 seconds