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

Home » Public Forums » archive » IDL postscript graphics
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL postscript graphics [message #45888 is a reply to message #45748] Sun, 09 October 2005 19:16 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
IDLmastertobe wrote:
> hi everyone,
>
> i am trying to print a 3D image in postscript format. I used to get the
> image and print the image into ps just the way i would print it as jpeg.
> but i found the quality is not good at all. Dr. Fanning suggested to use
> IDLgrClipboard and i am using the following code (most of the code were
> continued on from previous programmer):
>
> name=getinput('Enter File Name')
> file=dialog_pickfile(title='please select a directory',/directory)
> IF file EQ '' THEN RETURN
>
> ; Reconstruct the color table:
> TVLCT, r,g,b, /GET
>
> filename = file + name + '.ps'
>
> !P.FONT=0
>
> ; Set the plotting device to PostScript:
> SET_PLOT, 'ps'
>
> DEVICE, /TIMES, FONT_INDEX=3
> DEVICE, /SYMBOL, FONT_INDEX=7
>
> DEVICE, file=filename, BITS_PER_PIXEL=8, /COLOR
>
> LOADCT, 0
>
> clipboard = Obj_New("IDLgrClipboard", Dimensions=[4,3], Units=1, $
> Resolution=[2.54/300., 2.54/300.])
> clipboard->Draw, sState.oView, Filename=filename, /PostScript, /Vector
> Obj_Destroy, clipboard
>
> ; Close the file:
> DEVICE, /CLOSE
> set_plot,'win'
>
> however i found in the resulting ps file, the image is a white plane.
> there is no color at all. i tried to play with the colortable and found no
> solution. does anyone know why? I appreciate your time and patience.

The problem is that you are using two completely different graphics
systems (Direct Graphics and Object Graphics) to write to the same file.
Not a goood idea.

A second, minor, issue is that your code for selecting the file name is
a little klunky. The IDL function DIALOG_PICKFILE lets the user select
the file name and directory in one operation

Try replacing the above with

filename = dialog_pickfile(/WRITE, FILTER='*.eps')
if strlen(filename) gt 0 then begin
clipboard = Obj_New("IDLgrClipboard", Dimensions=[4,3], Units=1, $
Resolution=[2.54/300., 2.54/300.])
clipboard->Draw, sState.oView, Filename=filename, $
/PostScript, /Vector
Obj_Destroy, clipboard
endif

I don't guarantee this will work, because I can't vouch for the code
written by the "previous programmer", but at least it *could* work,
which is an improvement :-)


--
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stackplot without axis?
Next Topic: Fourier Transform when intervals are not uniform

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

Current Time: Wed Oct 08 19:36:05 PDT 2025

Total time taken to generate the page: 0.00256 seconds