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

Home » Public Forums » archive » Re: changing axis scale
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: changing axis scale [message #38099] Wed, 18 February 2004 12:38
u2s5thmember is currently offline  u2s5thmember
Messages: 11
Registered: January 2004
Junior Member
Kewl!!! You're SO AMAZING Dave!! and your example seems so easy now
that you pointed it out! :) A Million Thanks!!! :)
Re: changing axis scale [message #38114 is a reply to message #38099] Tue, 17 February 2004 15:19 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
BG writes:

> Could someone please suggest how I refer to those double tilde(~)
> symbols on the y-axis which indicate a break in the continuity of the
> scale? for example, as you read up the y-axis units, one might see:
> 0, 1, 2, 3, 4 double (~), 17, 18, 19, 20 (a log scale wouldn't show
> the fine detail of data in both areas.)
>
> Is this possible to do with IDL?

Here is an example of something very like it:

;*********************************************************** **********
PRO Test

; Create a suitable data set.
data = RandomU(-3L, 50) * 500
index = Where((data GT 250) AND (data LT 400), count)
IF count GT 0 THEN data[index] = data[index] + 150
index = Where((data GT 100) AND (data LE 250), count)
IF count GT 0 THEN data[index] = data[index] - 150
index = Where(data LT 0, count)
IF count GT 0 THEN data[index] = -data[index]
x = Indgen(50)
y = data

; Draw a normal plot of the data.
Window, 4, Title='Normal Plot of Data'
Plot, x, y, /NoData, Position=[0.15, 0.15, 0.95, 0.95], $
XTitle='Time', YTitle='Signal'
Oplot, x, y, PSym=4

; Draw a modified plot of the data. First, draw the
; lower half of the plot.
Window, 5, Title='Modified Plot of Data'
Plot, x, y, YRange=[0, 110], YStyle=1, XStyle=8, $
Position=[0.15, 0.15, 0.95, 0.50], /NoData, $
XTitle='Time'
index = Where(y LT 100, count)
IF count GT 0 THEN OPlot, x[index], y[index], PSym=4

; Draw the jagged lines that interrupt the plot.
ys = !Y.Window[1]
PlotS, [0.150, 0.183, 0.117, 0.183, 0.150], /Normal, $
[ys, ys+0.025, ys+0.05, ys+0.075, ys+0.1]

ys = !Y.Window[1]
PlotS, [0.950, 0.983, 0.917, 0.983, 0.950], /Normal, $
[ys, ys+0.025, ys+0.05, ys+0.075, ys+0.1]

; Draw the second half of the plot.
Plot, x, y, YRange=[390, 600], YStyle=1, XStyle=4, $
Position=[0.15, 0.60, 0.95, 0.95], /NoData, /NoErase
index = Where(y GT 400, count)
IF count GT 0 THEN OPlot, x[index], y[index], PSym=4

; Clean up by completing the parts of the plot that still
; need to be drawn.
Axis, XAxis=1, XTickformat='(A1)'
XYOutS, 0.05, 0.55, 'Signal', Orientation=90, /Normal, $
Alignment=0.5
END
;*********************************************************** **********

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: YSIZE of widget_list
Next Topic: Website update

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

Current Time: Fri Oct 10 07:27:37 PDT 2025

Total time taken to generate the page: 0.88226 seconds