SUMMARY: oplot - error in plotting to Z buffer only [message #14293] |
Fri, 12 February 1999 00:00 |
fireman
Messages: 49 Registered: August 1991
|
Member |
|
|
THE PROBLEM:
An error sometines arises when plotting to the Z-buffer:
% PLOT: No valid points, must have at least 2 distinct points
AN EXAMPLE:
IDL> ; first, compile the function CIRCLE at the end of this message
IDL> usersym,circle(0,0,1,20),/fill
IDL> plot,psym=8,yrange=[0,1],-0.01+FIndGen(100)/5000
IDL> set_plot,'z'
IDL> plot,psym=8,yrange=[0,1],-0.01+FIndGen(100)/5000
A SUSPECT:
It seems to have something to do with improper clipping to plot
boundaries when using filled user-defined symbols. Setting !P.Clip = 0
prevents the error but doesn't always result in desirable plots.
A WORKAROUND:
IDL> ;After setting plot boundaries with an initial plot,
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]
THE SOLUTION:
Upgrade to IDL 5.2
CREDITS:
Eduardo Santiago <esm@lanl.gov> for first pointing out the filled
psym/p.clip connection
Dick Jackson <djackson@dfanning.com> for giving a simple example, and for
pointing out that IDL 5.2 has corrected the problem.
Gwyn Fireman <Gwyn.Fireman@gsfc.nasa.gov> (me) for posting the workaround.
Thanks everyone!
--
---- Gwyn F. Fireman
---- General Sciences Corporation
---- MODIS Characterization Support Team
---- Gwyn.Fireman@gsfc.nasa.gov 301-352-2118
|
|
|