plot issues -> how to produce a mono plot? [changeset]
Ben Abbott
bpabbott at mac.com
Fri Jun 5 09:00:42 CDT 2009
On Jun 5, 2009, at 2:58 AM, Petr Mikulik wrote:
>>>>> x=-5:5;
>>>>> plot(x,x, x,1-x, x,1+x)
>>>>> print -dps mono.ps
>>>>> print -dpsc color.ps
>>>>> print -deps mono.eps
>>>>> print -depsc color.eps
>>>>>
>>>>> Bug: mono.(e)ps should be monochromatic and solid, but they are
>>>>> color and
>>>>> dashed; it should use:
>>>>> set term postscript {eps} monochrome solid
>>>>
>>>> Running Matlab, the -dps and -deps devices produce color output
>>>> for patches
>>>> but BW for images (the colorbar for example).
>>>>
>>>> Thus, it is not clear to me what constitutes compatible behavior.
>>>> To
>>>> produce
>>>> BW images running Octave, add the "-mono" option.
>>>
>>> Compatibility seems to be:
>>> - -dps, -deps ... monochromatic solid
>>>
>>> - -dpsc, -depsc ... color solid
>>>
>>> - There seems to be no -mono option in Matlab neither. So I
>>> propose that
>>> "-dps" and "-deps" produce monochrome solid and Octave's
>>> extention
>>> "-mono" would produce "monochrome dashed".
>>>
>>> - Actually, dashes are produced by:
>>> plot(x,-x,'-', x,y, '-.', x,x, '--')
>>> which means solid, dash-dot, dash-dash. They are equivalent in
>>> postscript
>>> to
>>> plot ... lt 1 lc rgb ..., ... lt 5 ..., ... lt 2 ...
>>>
>>> If Octave uses lt 1,5,2, then it could pass the "dash" option
>>> always and
>>> it will be compatible with Matlab's dashes.
>>
>>
>> Petr,
>>
>> I've tried to modify print.m to behave as you describe above.
>> Unfortunately,
>> my attempt has failed.
>>
>> Presently, the terminal command piped to gnuplot is ...
>>
>> set terminal postscript enhanced eps mono dashed size
>> 7.98611111111111,5.98611111111111
>>
>> As the "mono" option is present, I'd assumed that was sufficient to
>> render a
>> BW image. However, the image is color. Looking at gnuplot's
>> documentation is
>> appears that the "mono" option in the terminal command results in
>> producing BW
>> rendering as the default. However, if an object is given a color
>> specification
>> it is then rendered in the colors specified. This behavior makes it
>> difficult
>> for Octave to produce a BW image.
>>
>> Is there a method to force gnuplot to render a mono image, even
>> when a color
>> spec is provided?
>
> For text, please use
> set term postcript monochrome blacktext
>
> There was a discussion about this issue some months ago on gnuplot's
> list
> what to do if monochrome option is on and lines, points and images are
> explicitly colour. It was found that gnuplot cannot change these
> ambiguities
> in a consistent way, because it is hard to say "this palette is/has
> to be
> gray" or "black". Therefore all these elements with explicit RGB
> specs are
> let in colour. So it's up to Octave to use colours or B&W specs.
I've made an attempt to force monochromatic results when when the "-
mono" option is given or when the device is ps, ps2, eps, or eps2.
A changeset is attached.
Petr, please verity this works for you. I'll delay pushing it until
the issue (reference below) with rgb2gray has been resolved.
--------------------
octave:6> h = plot (1:10)
octave:7> set (h, "color", rgb2gray (get (h, "color")))
error: invalid value for color property "color"
--------------------
http://www-old.cae.wisc.edu/pipermail/bug-octave/2009-June/008731.html
Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changeset.patch
Type: application/octet-stream
Size: 3274 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20090605/97b6d9c2/attachment.obj
-------------- next part --------------
More information about the Bug-octave
mailing list