comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: background colour in contour plots

Re: background colour in contour plots
type: item
description: Ioannis Marangopoulos writes: > I'm using pv-wave to create contour plots of an ultrasound > field.When the plots appear on screen the background is black, > however when the postcript file is created and printed is coming > out with a white background.The white background is convenient > in most cases, however in order to have good contrast for some of my colours > -contours(eg yellow doesn't look good on white background!) > I need to get the background black.This works only if I snapshot the plot off > the screen.Any ideas on how to change the background into black in the postcript > file?? This answer comes from one of the many tips on PostScript output that you will find on my web page. ************************************************************ ******* The !P.BACKGROUND system variable is set to 255 when you make the PostScript device active. But it doesn't matter what color you load into color index 255, you still get a white background on your PostScript plot! In other words, the color you load into index 255 can be used for other things (as a drawing color, for example), but it doesn't affect the background color of the plot. There is only one way to get a background color different from white in a PostScript file, and that is essentially to draw an image of a single color in the PostScript window. I like to use POLYFILL for this purpose, like this: TVLCT, [255,0], [0,255], [0,0], !D.N_COLORS-2 greenColor = !D.N_COLORS-1 redColor = !D.N_COLORS-2 POLYFILL, [1,1,0,0,1], [1,0,0,1,1], /NORMAL, COLOR=greenColor PLOT, data, COLOR=redColor, /NOERASE Another way would be to use the TV command like this: image = REPLICATE(greenColor, 2, 2) TV, image, XSIZE=!D.X_SIZE, YSIZE=!D.Y_SIZE PLOT, data, COLOR=redColor, /NOERASE ************************************************************ ******** Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting Customizable IDL Programming Courses Phone: 970-221-0438 E-Mail: davidf@dfanning.com Coyote's Guide to IDL Program…
creator: davidf
date: 1997-08-28T07:00:00-00:00