|
From: Philipp K. J. <ja...@ie...> - 2008-07-31 05:56:36
|
Ok, apparently we really misunderstood each other. Let me try again. If I say: set style fill pattern set style histogram clustered set style data histogram plot "data" u 1, "" u 2, "" u 3 gnuplot will iterate through the available patterns for data in column 1, 2, and 3. If instead I say set style fill solid ... gnuplot will iterate through the available colors (red, green, blue, ...) But what if I want a monochrome output? I can't use red, green, blue, .... Instead I must use shades of gray. What I therefore want is for gnuplot to iterate through densities: not patterns, not colors. Just a single color, but different densities of that color. I wonder whether there is currently support for that. Best, Ph. On Wednesday 30 July 2008 22:03, you wrote: > On Wednesday 30 July 2008, Philipp K. Janert wrote: > > What I hear you say here is this, I think: > > > > Gnuplot has a way to automatically select > > different fill patterns (which will work in B&W), > > and different fill colors (which require a color > > terminal). > > Both, actually. It's your choice whether to use colors > or fill-patterns or both. > > > But gnuplot does NOT have a way to automatically > > select different monochrome fill densities. To > > achieve such an effect, I have to start hacking > > Postscript. > > No, I didn't intend to say that at all. > I may have misunderstood your question. > I thought you were asking about how you might print a > previously-created PostScript file on a monochrome printer > even though it was originally created using color. I explained > one wasy to do this. > > If you are asking instead how you could create halftone output in > the first place, that's a different question. What exactly are > you trying to do? There may well be several alternatives available. > > > What we really would want is something that cycles > > through fill densities, in the same way that gnuplot > > cycles through line types. > > I think that is possible now, although perhaps not as conveniently > as you would like. > > # Define a set of sequential gray values > set style line 101 lc rgb "grey10" > set style line 102 lc rgb "grey70" > set style line 103 lc rgb "grey20" > set style line 104 lc rgb "grey80" > ... > set style increment user # horrible syntax, but it's what we've got > > set style histogram cluster > set style fill solid 1 noborder > > plot newhistogram lt 101, for [i=1:10] 'datafile' using i with histogram > > > Alternatively, we could have user-defined "fill styles", > > and then gnuplot could cycle through those. This way, > > users can define either a set of color fill styles, or > > monochrome density fill styles (or any combination > > thereof), and gnuplot would cycle through those. (I > > have no idea how hard that would be, and I would not > > think it is high priority, though.) > > Adding a mechanism to re-map the order of existing fill patterns would be > easy. What seems well-nigh impossible is to provide a terminal-independent > way of defining new fill styles. > > Ethan > > > On Wednesday 30 July 2008 19:05, you wrote: > > > On Wednesday 30 July 2008, Philipp K. Janert wrote: > > > > Let's say I am trying to generate histograms > > > > like this: > > > > > > > > set style fill solid > > > > set style histogram clustered > > > > set style data histogram > > > > plot "data" u 1, "" u 2, "" u 3 > > > > > > > > I get a plot of histograms, with each "bin" > > > > in a different color (red, green, blue). > > > > > > > > Now, I would like to export this to a monochrome > > > > Postscript terminal. I would expect that the colors > > > > are mapped to different levels of grayscale. > > > > > > > > Instead, all colors seem to be mapped to black > > > > (or very nearly black). > > > > > > > > Is there a way to achieve the kind of automatic > > > > color-to-grayscale mapping I envision, or is this > > > > currently not supported? > > > > > > The issue is that there are two uses of color. > > > > > > One is to create a palette that captures a continuous quantity. > > > To convert this to a monochrome plot you want a greyscale mapping, > > > and that's what the postscript terminals do if you select "mono". > > > > > > The other use of color is simply to differentiate object A from > > > object B. Here a greyscale is irrelevant, and you instead want > > > some mapping that makes the common colors maximally distinct from > > > each other. > > > > > > I suggest that a clever way to achieve the latter goal is to > > > in this case redefine the PostScript setrgbcolor operator so > > > that you get an NTSC (black-and-white TV) mapping of the colors. > > > One line in the PostScript prolog suffices for this, so local > > > modification without touching the gnuplot executable is very > > > easy. I've posted complete instructions several times, but > > > I don't seem to have saved a copy on my local disk. |