Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I assume that you want the line to be drawn on the circles. You can simply achieve that if you add zorder=n, with n greater than or equal to 5, as an option of line, i.e

l = line([(0,1), (1,1),(1,0)], linestyle="--", zorder=5)

The problem is that zorder has no default value for the line, but it has been set to 5 for the circles. Hence, the line is not drawn in the right layer, even if it appears as the last object added to the figure. We can see this as follows. First, the zorder for the circles:

sage: [c[0].options()['zorder']  for c in [c1, c2, center, p1, p2, p3, p4]]
[5, 5, 5, 5, 5, 5, 5]

However,

sage: l[0].options()['zorder']
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-14-075edb4cde49> in <module>()
----> 1 l[Integer(0)].options()['zorder']
KeyError: 'zorder'

By the way, I would not use l as a variable, since it can be easily confused with 1.