|
From: Philipp K. J. <ja...@ie...> - 2008-07-31 01:10:20
|
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? Best, Ph. |
|
From: Ethan A M. <merritt@u.washington.edu> - 2008-07-31 02:05:14
|
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. -- Ethan A Merritt |
|
From: Philipp K. J. <ja...@ie...> - 2008-07-31 03:20:43
|
Thanks for your reply. 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). 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. I am not sure that an NTSC mapping is ideal, though. What we really would want is something that cycles through fill densities, in the same way that gnuplot cycles through line types. 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.) Best, Ph. 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. |
|
From: Ethan A M. <merritt@u.washington.edu> - 2008-07-31 05:03:57
|
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. > -- Ethan A Merritt |
|
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. |
|
From: Ethan A M. <merritt@u.washington.edu> - 2008-07-31 06:11:54
|
On Wednesday 30 July 2008, Philipp K. Janert wrote: > > 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 But isn't that exactly what you are saying you want? > 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. Color, or grey? I guess I'm still confused about whether you really care about density, or if that's just a convenient stand-in for a monochrome greyscale. The example I showed used grey partly because there are pre-defined names for the incremental grey values. It would work just as well for arbitrary color densities, but you'd have to give them in the form "lc rgb '#RRGGBB'" Unfortunately, not that many terminals support a uniform density setting or a uniform transparency setting. And even if they did, it would end up with the same grayscale values as in the example I gave. So I don't think this would actually add anything to the set of capabilities. It happens that there are a few terminals that implement pattern fill as a cycle of greyscale settings because they don't really offer patterns. You could experiment with the emf terminal, say, and see what you think of it. I suppose we could offer this as an optional alternative to pattern-fill on other terminal types. > 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. > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |
|
From: Ethan A M. <merritt@u.washington.edu> - 2008-07-31 06:22:22
|
On Wednesday 30 July 2008, Ethan A Merritt wrote:
> 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.
^^^^^^^^^^^
By which I meant "new fill patterns". If you just want to use colors + density,
then it would be possible.
|
|
From: Philipp K. J. <ja...@ie...> - 2008-07-31 15:33:22
|
I meant colors and densities. Not patterns. (That would be a nightmare, for sure.) On Wednesday 30 July 2008 23:22, you wrote: > On Wednesday 30 July 2008, Ethan A Merritt wrote: > > 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. > > ^^^^^^^^^^^ > > By which I meant "new fill patterns". If you just want to use colors + > density, then it would be possible. |