comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: Postscript-problem... :((

Re: Postscript-problem... :((
type: item
description: 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 ---------------------------------…
creator: davidf
date: 1997-11-13T08:00:00-00:00

Re: Postscript-problem... :((
type: item
description: 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, 'Magent…
creator: Liam Gumley
date: 1997-11-14T08:00:00-00:00

Re: Postscript-problem... :((
type: item
description: 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/
creator: davidf
date: 1997-11-14T08:00:00-00:00

Re: Postscript-problem... :((
type: item
description: 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
creator: rew032
date: 1997-11-14T08:00:00-00:00