Dear Gert,

On 17.06.15, Gert-Ludwig Ingold wrote:
> while playing around with stacked bars, I came across a case where the
> stack height is zero. When I try to suppress the borders, I still get
> a thin line for the stack of zero height. Suppressing the borders by
> setting the linewidth to zero did not help either because a very thin
> line (1 pixel?) remained. As a minimal example, I modified the code
> from the examples:
> 
> from pyx import *
> 
> data = [('a', 0, 2), ('b', 2, 3), ('c', 2, 2)]
> 
> g = graph.graphxy(width=14, height=6, x=graph.axis.bar())
> g.plot(graph.data.points(data, xname=1, y=2, stack=3),
>                [graph.style.bar([deco.stroked([])]),
>                 graph.style.stackedbarpos("stack"),
>                 graph.style.bar([color.rgb.green, deco.stroked([])]),
>                ])
> g.writePDFfile()
> 
> My problem is with the thin green line in the third bar.
> 
> Shouldn't the bar graph avoid drawing anything if the height is zero?

André has already explained the technical points, so I only add my
opinion, which is along the lines of better explicit than implicit: If
you pass data containing stacks of height zero to the bar graph you
might have a reason and want to draw the degenerate bars. Otherwise,
just filter the data before.

But maybe I am missing something, and PyX is indeed behaving in an
unexpected way.

Best regards,

        Jörg

------------------------------------------------------------------------------
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to