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

Home » Public Forums » archive » Re: Postscript-problem... :((
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: Postscript-problem... :(( [message #10280] Fri, 14 November 1997 00:00
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
A.Kuhr wrote:

> Thank you very much, now not only an orange rectangle... :))))
>
> But 2 other problems occured.... :(((
>
> - the resolution of the printed postscript is very :((( to, like gif.....
> how get a 'nicer' picture...?
>
> - something goes wrong with the colormap.
> on the screen I have colors from blue to red, on the ps only from
> blue to yellow...??
> whats going wrong..?

Astrid,

Try the routine found at the end of this message (colors.pro). I use it to
define 16 graphics colors, usually starting at index 0 in the color table.
See the example in the program code. To use it with Postscript, try this:

;- Do this once before you create the first graphics window in a new IDL
session
device, decomposed = 0

;- Turn on color Postscript output to 'idl.ps'
current = !d.name
set_plot, 'PS'
device, /landscape, /color, bits = 8

;- Load the graphics colors
colors

;- Insert your plot commands here
xyouts, 0.0, 0.05, 'Magenta', /normal, charsize = 5.0, color = 1
xyouts, 0.0, 0.25, 'Red', /normal, charsize = 5.0, color = 5
xyouts, 0.0, 0.50, 'Green', /normal, charsize = 5.0, color = 4
xyouts, 0.0, 0.75, 'Blue', /normal, charsize = 5.0, color = 6

;- Turn off Postscript output (very important!)
device, /close
set_plot, current

There are a few additional tricks if you want to display images with a
separate color table, but this should get you started.

Cheers,
Liam.

;----------
pro colors, start = start

;+
; Purpose:
; Load the sixteen McIDAS graphics colors into the current color table.
;
; Calling Sequence:
; COLORS, START = START
;
; Optional Keywords:
; START Start index in the color table where the McIDAS graphics
; colors will be loaded (default = 0).
;
; Notes:
; The color table assignments are as follows
; 0 => black
; 1 => magenta
; 2 => cyan
; 3 => yellow
; 4 => green
; 5 => red
; 6 => blue
; 7 => white
; 8 => navy
; 9 => gold
; 10 => pink
; 11 => aquamarine
; 12 => orchid
; 13 => gray
; 14 => sky
; 15 => beige
;
; Example:
;
;colors
;xyouts, 0.0, 0.05, 'Magenta', /normal, charsize = 5.0, color = 1
;xyouts, 0.0, 0.25, 'Red', /normal, charsize = 5.0, color = 5
;xyouts, 0.0, 0.50, 'Green', /normal, charsize = 5.0, color = 4
;xyouts, 0.0, 0.75, 'Blue', /normal, charsize = 5.0, color = 6
;
; Revised:
; 24-JULY-1996 Liam Gumley, CIMSS/SSEC
;-

;- check keywords

if n_elements( start ) eq 0 then start = 0

;- load McIDAS graphics color tables

r = [0,255,0,255,0,255,0,255,0,255,255,112,219,127,0,255]
g = [0,0,255,255,255,0,0,255,0,187,127,219,112,127,163,171]
b = [0,255,255,0,0,0,255,255,115,0,127,147,219,127,255,127]
tvlct, r, g, b, start

end
;----------
Re: Postscript-problem... :(( [message #10284 is a reply to message #10280] Fri, 14 November 1997 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
A.Kuhr (rew032@isr141.isr.kfa-juelich.de) writes:

> Thank you very much, now not only an orange rectangle... :))))
>
> But 2 other problems occured.... :(((
>
> - the resolution of the printed postscript is very :((( to, like gif.....
> how get a 'nicer' picture...?

Yes, it is a *screen dump* you are doing. Resolution is
VERY low compared to true PostScript output. To get a nicer
PostScript picture re-issue the exact same commands that got
you that nice picture on your display. It would help if those
commands were in a separate procedure. :-)

> - something goes wrong with the colormap.
> on the screen I have colors from blue to red, on the ps only from
> blue to yellow...??
> whats going wrong..?

Uh, probably you didn't do *exactly* what I suggested in my
earlier message and reload those color vectors after you got
into the PostScript device. :-)

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Postscript-problem... :(( [message #10285 is a reply to message #10280] Fri, 14 November 1997 00:00 Go to previous message
rew032 is currently offline  rew032
Messages: 14
Registered: July 1996
Junior Member
Hello!

Thank you very much, now not only an orange rectangle... :))))

But 2 other problems occured.... :(((

- the resolution of the printed postscript is very :((( to, like gif.....
how get a 'nicer' picture...?

- something goes wrong with the colormap.
on the screen I have colors from blue to red, on the ps only from
blue to yellow...??
whats going wrong..?

Regards, Astrid
Re: Postscript-problem... :(( [message #10287 is a reply to message #10280] Thu, 13 November 1997 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
A.Kuhr (rew032@isr141.isr.kfa-juelich.de) writes:

> We have a problem with the postscript output......

Sigh...

> First we produce a plot on the screen, e.g. a xy-plot.
> Than, with a button, we do this:
>
> 'GTest' : $
> BEGIN
> TVLCT, r, g, b, /GET
> Pict = TVRD()
> WRITE_GIF, 'plottest.gif', Pict, r, g, b
> SET_PLOT, 'ps'
> DEVICE, /COLOR
> TV, Pict
> DEVICE, /CLOSE
> SET_PLOT, 'x'
>
> the gif-file is 'very' nice, but no good resolution for printing.
> therefor we store an additional ps-file.
> it has a nice resolution i think, but it shows not the xy-plot,
> only a orange rectangular instead..... :(((((
>
> can anyone help?

If only you had asked this question after next week, then
any of the people in my IDL Programming Techniques course
next week would be able to give you the answer. :-)

The truth is, any of a number of things could be going
wrong. I see several mistakes in this code. And even if
the code worked, I am not sure the screen dump into a
PostScript file will improve your output resolution, since
a screen dump is, well, a screen dump. 72 pixels per inch
is about a good as you can do.

But given that I am on the final pages of my book and I
want to finish the damn thing today, here is what I can
offer as a quick fix. Read the Producing Perfect PostScript
Output articles on my web page. Not everything you need to
know is in there (yet), but you will get some ideas. While
you are there, pick up the program PSWindow.

Then try writing your program like this:

GTest' : $
BEGIN
TVLCT, r, g, b, /GET
Pict = TVRD()
WRITE_GIF, 'plottest.gif', Pict, r, g, b
windowSize = PSWindow()
SET_PLOT, 'ps'
TVLCT, r, g, b
DEVICE, /COLOR, Bits_per_Pixel=8, _Extra=windowSize
TV, Pict
DEVICE, /CLOSE
SET_PLOT, 'x'

If that doesn't give you something other than an orange
rectangle, then I suspect something may be the matter with
the TVRD() command. I generally read from a pixmap instead
of from the display to avoid occasional problems.

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
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: Metrics for IDL programs
Next Topic: CGM output from object graphics

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

Current Time: Wed Oct 08 13:38:33 PDT 2025

Total time taken to generate the page: 0.00870 seconds