plot issues -> how to produce a mono plot?

Petr Mikulik mikulik at physics.muni.cz
Fri Jun 5 01:58:54 CDT 2009


> > > >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.

---
Petr Mikulik


More information about the Bug-octave mailing list