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

Home » Public Forums » archive » oplot
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
oplot [message #17728] Fri, 12 November 1999 00:00 Go to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Who knows more about this error?

It happens only using Z-Buffer. If I am using my screen no error
happens.
% OPLOT: No valid points, must have at least 2 distinct points


I tried on IBM AIX and WIN NT

Later on I'll post a small example.

R.Bauer
Re: oplot [message #17837 is a reply to message #17728] Tue, 16 November 1999 00:00 Go to previous messageGo to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Gwyn Fireman wrote:

> R.Bauer (R.Bauer@fz-juelich.de) wrote:
> : > > Who knows more about this error?
>
> This happened to me when I was using USERSYM and had no points in the
> current plot range. This behavior is supposed to have been fixed in IDL
> 5.2. I've been using this workaround:
>
> IDL> clip = where( (x gt !x.crange[0]) and (x lt !x.crange[1]) $
> IDL> and (y gt !y.crange[0]) and (y lt !y.crange[1]) )
> IDL> oplot, x[clip], y[clip]
>
> --
> -- Gwyn F. Fireman
> -- General Sciences Corporation / MODIS Characterization Support Team
> -- Gwyn.Fireman@gsfc.nasa.gov 301-352-2118

Thanks,

it is a problem with the usersym.
I'll try to make an example.
My data is in the range.


R.Bauer
Re: oplot [message #17854 is a reply to message #17728] Mon, 15 November 1999 00:00 Go to previous messageGo to next message
fireman is currently offline  fireman
Messages: 49
Registered: August 1991
Member
R.Bauer (R.Bauer@fz-juelich.de) wrote:
: > > Who knows more about this error?

This happened to me when I was using USERSYM and had no points in the
current plot range. This behavior is supposed to have been fixed in IDL
5.2. I've been using this workaround:

IDL> clip = where( (x gt !x.crange[0]) and (x lt !x.crange[1]) $
IDL> and (y gt !y.crange[0]) and (y lt !y.crange[1]) )
IDL> oplot, x[clip], y[clip]


--
-- Gwyn F. Fireman
-- General Sciences Corporation / MODIS Characterization Support Team
-- Gwyn.Fireman@gsfc.nasa.gov 301-352-2118
Re: oplot [message #17855 is a reply to message #17728] Mon, 15 November 1999 00:00 Go to previous messageGo to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Michael Werger wrote:

> "R.Bauer" wrote:
>>
>> Who knows more about this error?
>>
>> It happens only using Z-Buffer. If I am using my screen no error
>> happens.
>> % OPLOT: No valid points, must have at least 2 distinct points
>>
>> I tried on IBM AIX and WIN NT
>>
>> Later on I'll post a small example.
>>
>> R.Bauer
>
> THis is the usual error when you supply only a scalar to plot
> or oplot as argument, regardless if this is the first or second
> arg..
> But let's see your example.
> --

I have a vector If not I will get the same error on screen not
especially on Z-Buffer.

I have at the moment no small example to reproduce this error, may be
next week.

R.Bauer
Re: oplot [message #17856 is a reply to message #17728] Mon, 15 November 1999 00:00 Go to previous messageGo to next message
Michael Werger is currently offline  Michael Werger
Messages: 34
Registered: May 1997
Member
"R.Bauer" wrote:
>
> Who knows more about this error?
>
> It happens only using Z-Buffer. If I am using my screen no error
> happens.
> % OPLOT: No valid points, must have at least 2 distinct points
>
> I tried on IBM AIX and WIN NT
>
> Later on I'll post a small example.
>
> R.Bauer

THis is the usual error when you supply only a scalar to plot
or oplot as argument, regardless if this is the first or second
arg..
But let's see your example.
--
Michael Werger ------------o
ESA ESTEC & Praesepe B.V. |
Astrophysics Division mwerger@astro.estec.esa.nl|
| Postbus 299 http://astro.estec.esa.nl |
| 2200 AG Noordwijk +31 71 565 3783 (Voice)
o------------------- The Netherlands +31 71 565 4690 (FAX)
Re: oplot [message #69519 is a reply to message #17728] Mon, 25 January 2010 10:29 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
mgalloy wrote:
>
> I think you want something like:
>
> if (i eq 0) then begin
> window, /free
> win1 = !d.window
> plot, x1, y1
>
> window, /free
> win2 = !d.window
> plot, w1, z1
>
> ...
> endif else begin
> wset, win1
> oplot, x2, y2
>
> wset, win2
> plot, w2, z2
>
> ...
> endelse

And you might want to save the !X and !Y sysvars after each PLOT and then restore then
before each OPLOT for each of the two plots, e.g.

; Master save
xsave = !x
ysave = !y

if (i eq 0) then begin
window, /free
win1 = !d.window
plot, x1, y1
x1save = !x
y1save = !y

window, /free
win2 = !d.window
plot, w1, z1
x2save = !x
y2save = !y

...
endif else begin
wset, win1
!x = x1save
!y = y1save
oplot, x2, y2

wset, win2
!x = x2save
!y = y2save
oplot, w2, z2

...
endelse

; Master restore
!x = xsave
!y = ysave


Probably overkill, but still...

cheers,

paulv
Re: oplot [message #69520 is a reply to message #17728] Mon, 25 January 2010 09:24 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 1/25/10 7:16 AM, bing999 wrote:
> Hi,
>
> here is what i am trying to do:
>
>
> "for i = 0,10 do begin
>
> if i eq 0 then begin
> plot,x1,y1,........
> plot,w1,z1,........
> .............
> endif else begin
> oplot,x2,y2
> oplot,w2,z2
> ..................
> endelse
>
> endfor"
>
> but i want the "oplot,x2,y2" to overplot the "plot,x1,y1,........" ,
> the "oplot,w2,z2" to overplot " plot,w1,z1,........" and so on; that
> is to say, i want that each "oplot" command applies to the
> corresponding "plot" procedure.
> Whereas when i do the script written above, it overplots everything on
> the last plot.
> Is there any way to allocate a name/number to each "plot" procedure in
> order to overplot the corresponding thing on it? like:
>
>
> "for i = 0,10 do begin
>
> if i eq 0 then begin
> plot,x1,y1,NAME=1
> plot,w1,z1,NAME=2
> .............
> endif else begin
> oplot,x2,y2,NAME=1
> oplot,w2,z2,NAME=2
> ..................
> endelse
>
> endfor"
>
>
> Thank you!

I think you want something like:

if (i eq 0) then begin
window, /free
win1 = !d.window
plot, x1, y1

window, /free
win2 = !d.window
plot, w1, z1

...
endif else begin
wset, win1
oplot, x2, y2

wset, win2
plot, w2, z2

...
endelse

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
Re: oplot [message #69629 is a reply to message #17728] Thu, 28 January 2010 15:22 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
bing999 wrote:
> It does not work... It still oplots everything on the last plot...
> I must keep only the "x1save = !x y1save = !y " after the "plot" and
> the "!x = x1save !y = y1save" before the "oplot", thats it?
>
> Are the " ; Master save
> xsave = !x
> ysave = !y"
> and " ; Master restore
> !x = xsave
> !y = ysave "
>
> lines respectively at the beginning and the end of the script are
> useful? Should I add them?

No. You can't do what you originally asked for when the output is PS. In the context of
IDL, there is no way to overplot on a previous page in a PS file. With direct graphics
it's obviously easy (via WSET), but there is no PS equivalent (that I'm aware of).

It might be possible to do what you want in PostScript itself (via some arcane PS command).

The easiest solution would be to restructure your code to output each plot to a different
PS file.

cheers,

paulv

> Thank you for your help!
>
>
>> Hi, thanks for your answers. I should have mentionned that i want to
>> save the plots as .ps then i use :
>>
>> set_plot, 'ps'
>> device, filename='myplots.ps',/color,bits_per_pixel=8
>> ..............................
>> device, /close
>>
>> and what you proposed seems not to work with such environment.
>> Is it possible to arrange that?
>> Thanks!
>>
>>> mgalloy wrote:
>>>> I think you want something like:
>>>> if (i eq 0) then begin
>>>> window, /free
>>>> win1 = !d.window
>>>> plot, x1, y1
>>>> window, /free
>>>> win2 = !d.window
>>>> plot, w1, z1
>>>> ...
>>>> endif else begin
>>>> wset, win1
>>>> oplot, x2, y2
>>>> wset, win2
>>>> plot, w2, z2
>>>> ...
>>>> endelse
>>> And you might want to save the !X and !Y sysvars after each PLOT and then restore then
>>> before each OPLOT for each of the two plots, e.g.
>>> ; Master save
>>> xsave = !x
>>> ysave = !y
>>> if (i eq 0) then begin
>>> window, /free
>>> win1 = !d.window
>>> plot, x1, y1
>>> x1save = !x
>>> y1save = !y
>>> window, /free
>>> win2 = !d.window
>>> plot, w1, z1
>>> x2save = !x
>>> y2save = !y
>>> ...
>>> endif else begin
>>> wset, win1
>>> !x = x1save
>>> !y = y1save
>>> oplot, x2, y2
>>> wset, win2
>>> !x = x2save
>>> !y = y2save
>>> oplot, w2, z2
>>> ...
>>> endelse
>>> ; Master restore
>>> !x = xsave
>>> !y = ysave
>>> Probably overkill, but still...
>>> cheers,
>>> paulv
>>
>
Re: oplot [message #69662 is a reply to message #17728] Tue, 26 January 2010 04:35 Go to previous messageGo to next message
Thibault Garel is currently offline  Thibault Garel
Messages: 55
Registered: October 2009
Member
It does not work... It still oplots everything on the last plot...
I must keep only the "x1save = !x y1save = !y " after the "plot" and
the "!x = x1save !y = y1save" before the "oplot", thats it?

Are the " ; Master save
xsave = !x
ysave = !y"
and " ; Master restore
!x = xsave
!y = ysave "

lines respectively at the beginning and the end of the script are
useful? Should I add them?
Thank you for your help!


> Hi, thanks for your answers. I should have mentionned that i want to
> save the plots as .ps then i use :
>
>   set_plot, 'ps'
>   device, filename='myplots.ps',/color,bits_per_pixel=8
> ..............................
>   device, /close
>
> and what you proposed seems not to work with such environment.
> Is it possible to arrange that?
> Thanks!
>
>> mgalloy wrote:
>
>>> I think you want something like:
>
>>> if (i eq 0) then begin
>>>   window, /free
>>>   win1 = !d.window
>>>   plot, x1, y1
>
>>>   window, /free
>>>   win2 = !d.window
>>>   plot, w1, z1
>
>>>   ...
>>> endif else begin
>>>   wset, win1
>>>   oplot, x2, y2
>
>>>   wset, win2
>>>   plot, w2, z2
>
>>>  ...
>>> endelse
>
>> And you might want to save the !X and !Y sysvars after each PLOT and then restore then
>> before each OPLOT for each of the two plots, e.g.
>
>>  ; Master save
>>  xsave = !x
>>  ysave = !y
>
>>  if (i eq 0) then begin
>>    window, /free
>>    win1 = !d.window
>>    plot, x1, y1
>>    x1save = !x
>>    y1save = !y
>
>>    window, /free
>>    win2 = !d.window
>>    plot, w1, z1
>>    x2save = !x
>>    y2save = !y
>
>>    ...
>>  endif else begin
>>    wset, win1
>>    !x = x1save
>>    !y = y1save
>>    oplot, x2, y2
>
>>    wset, win2
>>    !x = x2save
>>    !y = y2save
>>    oplot, w2, z2
>
>>   ...
>>  endelse
>
>>  ; Master restore
>>  !x = xsave
>>  !y = ysave
>
>> Probably overkill, but still...
>
>> cheers,
>
>> paulv
>
>
Re: oplot [message #69663 is a reply to message #17728] Tue, 26 January 2010 03:19 Go to previous messageGo to next message
jkeller is currently offline  jkeller
Messages: 35
Registered: October 2009
Member
On Jan 26, 10:52 am, bing999 <thibaultga...@gmail.com> wrote:
> Hi, thanks for your answers. I should have mentionned that i want to
> save the plots as .ps then i use :
>
>   set_plot, 'ps'
>   device, filename='myplots.ps',/color,bits_per_pixel=8
> ..............................
>   device, /close
>
> and what you proposed seems not to work with such environment.
> Is it possible to arrange that?
> Thanks!
>
>> mgalloy wrote:
>
>>> I think you want something like:
>
>>> if (i eq 0) then begin
>>>   window, /free
>>>   win1 = !d.window
>>>   plot, x1, y1
>
>>>   window, /free
>>>   win2 = !d.window
>>>   plot, w1, z1
>
>>>   ...
>>> endif else begin
>>>   wset, win1
>>>   oplot, x2, y2
>
>>>   wset, win2
>>>   plot, w2, z2
>
>>>  ...
>>> endelse
>
>> And you might want to save the !X and !Y sysvars after each PLOT and then restore then
>> before each OPLOT for each of the two plots, e.g.
>
>>  ; Master save
>>  xsave = !x
>>  ysave = !y
>
>>  if (i eq 0) then begin
>>    window, /free
>>    win1 = !d.window
>>    plot, x1, y1
>>    x1save = !x
>>    y1save = !y
>
>>    window, /free
>>    win2 = !d.window
>>    plot, w1, z1
>>    x2save = !x
>>    y2save = !y
>
>>    ...
>>  endif else begin
>>    wset, win1
>>    !x = x1save
>>    !y = y1save
>>    oplot, x2, y2
>
>>    wset, win2
>>    !x = x2save
>>    !y = y2save
>>    oplot, w2, z2
>
>>   ...
>>  endelse
>
>>  ; Master restore
>>  !x = xsave
>>  !y = ysave
>
>> Probably overkill, but still...
>
>> cheers,
>
>> paulv
>
>

Just take the !x,!y,x1save,y1save etc. part from pauls solution
without the win stuff. That should work for you.

Regards,
Jan
Re: oplot [message #69665 is a reply to message #69519] Tue, 26 January 2010 01:52 Go to previous messageGo to next message
Thibault Garel is currently offline  Thibault Garel
Messages: 55
Registered: October 2009
Member
Hi, thanks for your answers. I should have mentionned that i want to
save the plots as .ps then i use :

set_plot, 'ps'
device, filename='myplots.ps',/color,bits_per_pixel=8
..............................
device, /close

and what you proposed seems not to work with such environment.
Is it possible to arrange that?
Thanks!


> mgalloy wrote:
>
>> I think you want something like:
>
>> if (i eq 0) then begin
>>   window, /free
>>   win1 = !d.window
>>   plot, x1, y1
>
>>   window, /free
>>   win2 = !d.window
>>   plot, w1, z1
>
>>   ...
>> endif else begin
>>   wset, win1
>>   oplot, x2, y2
>
>>   wset, win2
>>   plot, w2, z2
>
>>  ...
>> endelse
>
> And you might want to save the !X and !Y sysvars after each PLOT and then restore then
> before each OPLOT for each of the two plots, e.g.
>
>  ; Master save
>  xsave = !x
>  ysave = !y
>
>  if (i eq 0) then begin
>    window, /free
>    win1 = !d.window
>    plot, x1, y1
>    x1save = !x
>    y1save = !y
>
>    window, /free
>    win2 = !d.window
>    plot, w1, z1
>    x2save = !x
>    y2save = !y
>
>    ...
>  endif else begin
>    wset, win1
>    !x = x1save
>    !y = y1save
>    oplot, x2, y2
>
>    wset, win2
>    !x = x2save
>    !y = y2save
>    oplot, w2, z2
>
>   ...
>  endelse
>
>  ; Master restore
>  !x = xsave
>  !y = ysave
>
> Probably overkill, but still...
>
> cheers,
>
> paulv
Re: oplot [message #69744 is a reply to message #69629] Mon, 08 February 2010 21:37 Go to previous message
Gray is currently offline  Gray
Messages: 253
Registered: February 2010
Senior Member
On Jan 28, 6:22 pm, Paul van Delst <paul.vande...@noaa.gov> wrote:
> bing999 wrote:
>> It does not work... It still oplots everything on the last plot...
>> I must keep only the "x1save = !x y1save = !y " after the "plot" and
>> the "!x = x1save  !y = y1save" before the "oplot", thats it?
>
>> Are the " ; Master save
>>  xsave = !x
>>  ysave = !y"
>> and " ; Master restore
>>  !x = xsave
>>  !y = ysave "
>
>> lines respectively at the beginning and the end of the script are
>> useful? Should I add them?
>
> No. You can't do what you originally asked for when the output is PS. In the context of
> IDL, there is no way to overplot on a previous page in a PS file. With direct graphics
> it's obviously easy (via WSET), but there is no PS equivalent (that I'm aware of).
>
> It might be possible to do what you want in PostScript itself (via some arcane PS command).
>
> The easiest solution would be to restructure your code to output each plot to a different
> PS file.
>
> cheers,
>
> paulv
>
>> Thank you for your help!
>
>>> Hi, thanks for your answers. I should have mentionned that i want to
>>> save the plots as .ps then i use :
>
>>>   set_plot, 'ps'
>>>   device, filename='myplots.ps',/color,bits_per_pixel=8
>>> ..............................
>>>   device, /close
>
>>> and what you proposed seems not to work with such environment.
>>> Is it possible to arrange that?
>>> Thanks!
>
>>>> mgalloy wrote:
>>>> > I think you want something like:
>>>> > if (i eq 0) then begin
>>>> >   window, /free
>>>> >   win1 = !d.window
>>>> >   plot, x1, y1
>>>> >   window, /free
>>>> >   win2 = !d.window
>>>> >   plot, w1, z1
>>>> >   ...
>>>> > endif else begin
>>>> >   wset, win1
>>>> >   oplot, x2, y2
>>>> >   wset, win2
>>>> >   plot, w2, z2
>>>> >  ...
>>>> > endelse
>>>> And you might want to save the !X and !Y sysvars after each PLOT and then restore then
>>>> before each OPLOT for each of the two plots, e.g.
>>>>  ; Master save
>>>>  xsave = !x
>>>>  ysave = !y
>>>>  if (i eq 0) then begin
>>>>    window, /free
>>>>    win1 = !d.window
>>>>    plot, x1, y1
>>>>    x1save = !x
>>>>    y1save = !y
>>>>    window, /free
>>>>    win2 = !d.window
>>>>    plot, w1, z1
>>>>    x2save = !x
>>>>    y2save = !y
>>>>    ...
>>>>  endif else begin
>>>>    wset, win1
>>>>    !x = x1save
>>>>    !y = y1save
>>>>    oplot, x2, y2
>>>>    wset, win2
>>>>    !x = x2save
>>>>    !y = y2save
>>>>    oplot, w2, z2
>>>>   ...
>>>>  endelse
>>>>  ; Master restore
>>>>  !x = xsave
>>>>  !y = ysave
>>>> Probably overkill, but still...
>>>> cheers,
>>>> paulv
>

Can you use multiple windows in the z-buffer? If so, you could make
all your plots using the win and wset, then read the images and dump
them to a postscript. You would probably have resolution issues,
though, even if it worked.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: BSQ to BIL
Next Topic: Re: Extract / interpolate in 3d atmospheric field

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

Current Time: Wed Oct 08 13:41:58 PDT 2025

Total time taken to generate the page: 0.00796 seconds