Re: slightly shifted plots (?) [message #36988] |
Sun, 09 November 2003 01:59 |
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  |
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  |
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  |
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  |
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  |
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  |
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 #37005 is a reply to message #37003] |
Fri, 07 November 2003 07:01  |
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
|
|
|