Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: being cleve...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 5723 of 6022
Post > Topic >>

Re: being clever with postscript

by ianpaul.freeley@[EMAIL PROTECTED] May 12, 2008 at 03:18 PM

Here's the solution I came up with, I just wrote the stupid loops.  It
ends up clobbering whatever the original color table was, I'm too lazy
to put in the common blocks to fix that.  pyps is just my favorite
postscript opening procedure, then multi_ps sets up the correct
postscript files.


pro pyps, _extra=e, font=font, close=close, encapsulated=encapsulated

if not keyword_set(encapsulated) then encapsulated=0
;need to set this because IDL remembers /encap

if keyword_set(close) then begin
	device, /close
	set_plot, 'X'
	!x.thick=0	;return to normal
	!y.thick=0
        !p.font=-1      ;return to vector fonts
        !p.charsize=0
        !p.thick=0
	return
endif else begin
        if !d.name eq 'PS' then print, 'WARNING!  Already set to
Postscript.  Did you just forget to close another device?'
	set_plot, 'PS'
        if keyword_set(font) then !p.font=font else !p.font=0 ;set to
                                ;hardware font

	!x.thick=4	;thick lines are nice
	!y.thick=4
        !p.charsize=1.25  ;bigger font is nice
        !p.thick=2
	;if not keyword_set(landscape) then landscape=1	;landscape by default
	device, encapsulated=encapsulated, _extra=e, /times
	return
endelse



end

pro multi_ps, pn, filename=filename, _extra=e, hard_bw=hard_bw, $
              close=close

                                ;need to incor****ate a way to restore
                                ;the original color table that gets
                                ;clobbered when /hard_bw set.

  ;generate regular rgb
  if pn eq 0 then pyps, filename=filename+'_rgb.eps', /encapsulated, $
  /color, bits=8, _extra=e

  ;generate cmyk
  if pn eq 1 then pyps, filename=filename+'_cmyk.eps', /encapsulated,
$
  /color, bits=8, /cmyk, _extra=e

  ;generate B&W
  if pn eq 2 then begin
    if keyword_set(hard_bw) then  $
    tvlct, [[fltarr(256)],[fltarr(256)],[fltarr(256)]]

    pyps, filename=filename+'_bw.eps', /encapsulated
  endif




end

;try to make some good code for making three output files


x=findgen(101)
y=15.+x^2-3.*x


;now to make some plots

loadct, 39

for pn=0,2 do begin ;pn=plot number
  multi_ps, pn, filename='test', /hard_bw
  plot, x,y,/nodata
  oplot, x,y, color=250, psym=2
  pyps, /close
endfor



end
 




 4 Posts in Topic:
being clever with postscript
ianpaul.freeley@[EMAIL PR  2008-05-08 15:06:55 
Re: being clever with postscript
"Kenneth P. Bowman&q  2008-05-08 17:28:00 
Re: being clever with postscript
"R.G. Stockwell"  2008-05-09 12:10:24 
Re: being clever with postscript
ianpaul.freeley@[EMAIL PR  2008-05-12 15:18:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 22:45:09 CDT 2008.