only 2 line types? (Re: Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima)
Subject: only 2 line types? (Re: Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima)
From: Mario Rodriguez
Date: Thu, 20 Oct 2011 03:25:47 -0400
On 10/19/2011 07:07 PM, Mark H Weaver wrote:
> The draw package actually accepts two other undocumented line types:
> "dashes" and "dot_dash". However, these only work with the "eps" and
> "eps_color" terminals as far as I can tell. Also (on my system at
> least) "dot_dash" does not render as I'd expect, but rather as a plain
> dashed pattern, except with shorter dashes than "dashes".
>
> Best,
> Mark
I sent to Virgil the following replay some days ago. It seems I did not
clic the "Replay to all" button. I hope it clarifies the situation.
------------------
Hello,
> It seems that draw2d only supports 2 line types:
That's correct.
>
> ? line_type;
> `line_type' indicates how lines are displayed; possible values are
`solid' and `dots'.
>
> However it appears that gnuplot (which is the underlying plotting engine)
Yes, this is the default renderer.
> supports at least 4 (maybe more): solid, dashed, dotted, and
> dot-dashed lines (see
http://t16web.lanl.gov/Kawano/gnuplot/misc4-e.html for example). Those 4
types seem to be supported by common plotting tools.
You can read in this same link:
/* begin quote */
Some terminal cannot draw a dotted line, and some cannot change the
thickness. Then the number of possible combination is limited. The
following explanation is to use many kinds of lines in the postscript
terminal.
/* end quote */
That means that Gnuplot is not consistent in all terminals with respect
to line styles. The only types accepted by all draw-supported terminals
are 'solid' and 'dots', that's why these are, according to the
documentation, the only accepted styles.
But off-public I can tell you that you can also use types 'dashes' and
'dot_dash':
draw2d(
line_type = dots,
explicit(x^2, x, -1, 1),
line_type = solid,
explicit(x^2+1, x, -1, 1),
line_type = dashes,
explicit(x^2+2, x, -1, 1),
line_type = dot_dash, /* there is a known bug here to be fixed */
explicit(x^2+3, x, -1, 1),
terminal = eps )$
But it doesn't work with some other terminals. Try for example wxt, png,
and others.
Although these styles can be used in eps format, the main reason for
including them is to be used with the vtk renderer (experimental work),
together with a fith type named 'tube', for plotting curves and segments
as tubes. Examples here:
http://riotorto.users.sourceforge.net/vtk/param
>
> Assuming that the documentation is right about this, is there a
workaround to get draw2d to provide dashed, dot-dashed and any other
line type supported by gnuplot?
>
See above.
> BTW, in case you are wondering why not just use colors... the problem
with colors is that certain publications have color restrictions or
impose substantial fees for this service, and anyhow, one cannot be
certain that all end-readers will have color at his/her disposal (may be
reading a b/w photocopy or b/w printout). So, in a complex plot in which
separating lines is critical it is preferable to use both color and line
types. For this purpose, only two line types may be insufficient.
>
Of course, all these comments make sense to me.
> Best,
>
> Virgil
--
Mario