[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Proposing a change to linestyle FIXME
From: |
Jarno Rajahalme |
Subject: |
Proposing a change to linestyle FIXME |
Date: |
Tue, 2 Nov 2010 21:38:49 +0200 |
I was unable to print plots with solid lines. A simple plot with two line
objects, each set to linestyle "-", would print with one line solid, other
dashed. Even the "whiskers" in the errorbars were printing as various dashed
lines, when including multiple errorbars on the same plot.!
Using hours to dig up the cause I found this in __go_draw_axes__.m
## FIXME -- linetype is currently broken, since it disables the
## gnuplot default dashed and solid linestyles with the only
## benefit of being able to specify '--' and get a single sized
## dashed line of identical dash pattern for all called this way.
## All dash patterns are a subset of "with lines" and none of the
## lt specifications will correctly propagate into the x11 terminal
## or the print command. Therefore, it is currently disabled in
## order to allow print (..., "-dashed") etc. to work correctly.
## if (! isempty (lt))
## fprintf (plot_stream, " linetype %s", lt);
## endif
Changing the commented code to the following allows linetypes set to "-" to
always print as solid lines:
## Jarno Rajahalme 2.11.2010
## Allow lt 1 to go through to force solid lines, use "--" to use
## the various dashed backend linestyles
if (! isempty (lt))
if (lt == "1")
fprintf (plot_stream, " linetype %s", lt);
endif
endif
This is not any prettier than the disabling the linetype setting, but I think
this works better. Octave's errorbar code uses linetype "-" for the error
"whiskers", and with this change they actually print like they should, even
when plotting multiple errorbars on the same plot.
So, with this change, linestyle "-" always produces solid lines, whereas
linestyle "--" produces the various different dashed lines produced by gnuplot
(by backend) to the EPS printout.
Regards,
Jarno
- Proposing a change to linestyle FIXME,
Jarno Rajahalme <=