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

Home » Public Forums » archive » strange postscript error on certain IDL 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
strange postscript error on certain IDL plots [message #89646] Wed, 05 November 2014 06:41 Go to next message
Brian McNoldy is currently offline  Brian McNoldy
Messages: 35
Registered: July 2000
Member
I have some code that has been around and working perfectly for probably 10 years. It creates an EPS file, nothing fancy. I just tried using it this week and now I'm unable to view or convert the EPS file... I get the following error from ghostscript or ImageMagick:
Error: /rangecheck in --colorimage--

I am able to view and convert other EPS files, even others made by IDL in other programs. I'm using IDL 8.2, and my DEVICE command is simply:
device,file=path+title+'.eps',/encapsulated,/portrait,/inche s,$
xsize=xs,ysize=ys,/color,bits=8

This program does make plots using two separate color tables, one after the other. I plot topography in grayscale and then overlay contours in color. This was never a problem before though. If I comment out the topography plotting, it works, and I can view/convert the resulting EPS file. Will IDL no longer allow me to do this? An example plot can be found at http://andrew.rsmas.miami.edu/bmcnoldy/tmp/MAY_2000-2009_SST .eps-1.png

My question to the group is what could possibly be causing this new postscript error?

Thanks,
Brian
Re: strange postscript error on certain IDL plots [message #89647 is a reply to message #89646] Wed, 05 November 2014 07:16 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Brian McNoldy writes:

>
> I have some code that has been around and working perfectly for probably 10 years. It creates an EPS file, nothing fancy. I just tried using it this week and now I'm unable to view or convert the EPS file... I get the following error from ghostscript or ImageMagick:
> Error: /rangecheck in --colorimage--
>
> I am able to view and convert other EPS files, even others made by IDL in other programs. I'm using IDL 8.2, and my DEVICE command is simply:
> device,file=path+title+'.eps',/encapsulated,/portrait,/inche s,$
> xsize=xs,ysize=ys,/color,bits=8
>
> This program does make plots using two separate color tables, one after the other. I plot topography in grayscale and then overlay contours in color. This was never a problem before though. If I comment out the topography plotting, it works, and I can view/convert the resulting EPS file. Will IDL no longer allow me to do this? An example plot can be found at http://andrew.rsmas.miami.edu/bmcnoldy/tmp/MAY_2000-2009_SST .eps-1.png
>
> My question to the group is what could possibly be causing this new postscript error?

How long have you been working with computers? Practically anything, I
would say. QuiƩn sabe!

Cheers,

David

P.S. I doubt this has anything to do with IDL, though. Do you have
example code to create the PostScript file?

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: strange postscript error on certain IDL plots [message #89648 is a reply to message #89647] Wed, 05 November 2014 08:10 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> P.S. I doubt this has anything to do with IDL, though. Do you have
> example code to create the PostScript file?

No attempt to get anything right, except the same kind of plot you are
creating. It works great for me! Using IDL 8.2.3 on Windows.

image = cgDemoData(7)
image = cgScaleVector(image, -200.0, 1500.)
map = cgMap('Equirectangular', Limit=[-90, -180, 90, 180])
image = Shift(image, 180, 0)
dims = Size(image, /Dimensions)
lons = cgScaleVector(Findgen(dims[0]), -180, 180)
lats = cgScaleVector(Findgen(dims[1]), -90, 90)
cgLoadCT, 0
pos = [0.1, 0.3, 0.9, 0.9]
map -> SetProperty, Position=pos
cgDisplay
cgImage, image, Position=pos, /Scale, /Save, $
XRange=[-180,180], YRange=[-90,90]
cgColorbar, Range=[Min(image), Max(image)], $
Position=[0.1, 0.1, 0.4 , 0.15]
map -> Draw
cgMap_Grid, /Box, Map=map
conColors = ['red6', 'grn6', 'yellow', 'blu6']
TVLCT, cgColor(conColors, /Triple), 1
cgContour, image, lons, lats, Levels=[500, 750, 1000, 1200], $
/Fill, /Overplot, Map=map, C_Colors=Bindgen(4)+1B
cgColorBar, Range=[500, 1200], Divisions=3, $
Position=[0.6, 0.1, 0.9 , 0.15], NColors=4,Bottom=1
END

Code I used to create the plot:

IDL> cgPS_Open, 'test.ps'
IDL> .Run ps_example
IDL> cgPS_Close, /PNG, DELETE_PS=0

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Curve Fitting to timeseries using a set of 8 sine and cosine functions
Next Topic: reading data with numbers and strings from data file

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

Current Time: Wed Oct 08 09:22:59 PDT 2025

Total time taken to generate the page: 0.00376 seconds