>>>>> "Eric" == Eric Emsellem <emsellem@...> writes:
Eric> Hi, I am trying to overplot symbols on a region filled (with
Eric> pale grey color) between two curves. For some reason the
Eric> filled region is always ON TOP of the symbols so that I
Eric> don't see them..
Eric> (I wanted to use transparency with alpha, but then it is to
Eric> build a postscript figure which does not support
Eric> transparency, so this requires me to first plot the filled
Eric> region and then overplot the symbols...)
Eric> here is an example:
Eric> sampVS = arange(0.,1.,0.02) x = concatenate(
Eric> (sampVS,sampVS[::1]) ) alpha1 = 0.98486328 alpha2 =
Eric> 1.28486328 y1 = alpha1 * sampVS / sqrt(1.+(alpha1 *
Eric> sampVS)**2) y2 = alpha2 * sampVS / sqrt(1.+(alpha2 *
Eric> sampVS)**2) y = concatenate( (y1,y2[::1]) ) p = fill(x, y,
Eric> facecolor=(0.9,0.9,0.9)) scatter([0.4],[0.4])
Eric> ==> the symbol is hidden behind the filled region although
Eric> it is plotted afterwards...
scatter (a PatchCollection) and fill (a Polygon) both have a zorder of
1, which means they are drawn at the bottom of the draw hierarchy. We
take all the artists, sort them by zorder, and draw them in order.
You should set the zorder of your scatter to be higher than the zorder
of your fill. Eg
poly = fill(....)
col = scatter(...)
col.set_zorder( 1.1 * poly.get_zorder() )
See also examples/zorder_demo.py
JDH
