I am playing with the dashtype functionnality in Gnuplot 5.0_rc1 and I noticed some dysfunctions.
For grids, these two scripts display identical results
reset
set grid
plot x
reset
set grid dt 2
plot x
However, when a linetype is given, the dashtype is taken into account
reset
set grid lt 1 dt 2
plot x
For arrows, the problem is the same: the dashtype is applied only if a linetype is given.
Finally for rectangles, the dashtype is always ignored
reset
set object rect from 0,0 to 2,3 lt 1 dt 2
plot x
This script creates a rectangle with solid lines.
I made these tests on Windows 7 and the wxt terminal.
Grid:
By default the grid is drawn with linetype 0 (a.k.a. LT_AXIS) which is reserved for this purpose. It is a special linetype that has a built-in dot pattern and cannot be assigned a separate dash pattern. If you change the grid to use some other linetype then you can change the dash pattern as you like.
So this was intentional, but if people don't like it then we could reconsider.
Rectangles:
This seems to be a bug in something to do with interpreting the "set obj rectangle" command, or perhaps with applying it on top of the default settings. For example, here rect 2 is correctly drawn but rect 1 is not:
Arrows:
I think this is the same as with rectangles. It is a parsing bug rather than a rendering bug. Should be fixable.
The use of dash types in rectangles should now be fixed in CVS.
Arrows turn out to be a separate problem - basically the arrow code
was never modified to use the new dash types. To the extent it works
right now it's just happenstance.
On Wed, Aug 13, 2014 at 11:01 AM, Ethan Merritt sfeam@users.sf.net wrote:
Related
Bugs:
#1460The use of dash types in rectangles should now be fixed in CVS.
Arrows turn out to be a separate problem - basically the arrow code
was never modified to use the new dash types. To the extent it works
right now it's just happenstance.
Fixed now, I hope. The fix includes new code to insure that arrow heads are always drawn with a solid line even if the arrow shaft has a dash pattern.
Hi Ethan,
yes the dash types now apply also to rectangles. Unfortunately the line color is now ignored:
Thank you,
Christoph
But the command you show has never been legal:
In current 5.0.rc1 the command that does what you probably want is
That is, the dashtype and linewidth are properties of the rectangle itself, but the line colour is a property of the border. Version 4.6 was the same except of course that there was no dashtype property.
At one point I tried to attach all the properties to the border, but the code got horribly complex and I gave up on the idea. Conversely, one could make the linetype a property of the rectangle and do away with the border linetype, but that would break all previous scripts using rectangles.
Suggestions?
Yes, I got confused a bit regarding the syntax.
I think, if the dashtype is easier to implement as rectangle property instead of border property its fine for me. I was just a bit confused, since I didn't get an error using the wrong order.
BTW: Is the dashtype supposed to work also with circles? A command like
draws no circle at all.
Well, it actually does draw the circle. But the only color associated with that object is "background" so it draws in the background color and you can't see it.
The more general problem is that the current parsing routines get totally confused between "fillcolor" and "linecolor".