Grid line over shadows actual plotted line

I have charts which are using the add_collection function to draw financial bar charts. I also have the grid line enabled. When the chart is drawn (example can be seen at):

http://s3.amazonaws.com/oysb/wmt_n.png

any line drawn through add_collection which overlaps with the grid line does not get displayed. Is there a way to send the grid line to the background?

VJ

VJ,

Have you tried

ax.set_axisbelow(True)

where ax is your axes instance?

Eric

Vineet Jain wrote:

···

I have charts which are using the add_collection function to draw financial bar charts. I also have the grid line enabled. When the chart is drawn (example can be seen at):

http://s3.amazonaws.com/oysb/wmt_n.png

any line drawn through add_collection which overlaps with the grid line does not get displayed. Is there a way to send the grid line to the background?

VJ

ax.set_axisbelow(True)

Thanks a lot. That fixed the problem.

VJ

Is there a way to set this in the rc file? axisbelow(True) would be my default preference.

-Rob.

···

On May 7, 2006, at 11:15 PM, Vineet Jain wrote:

ax.set_axisbelow(True)

-----
Rob Hetland, Assistant Professor
Dept of Oceanography, Texas A&M University
p: 979-458-0096, f: 979-845-6331
e: hetland@...760..., w: http://pong.tamu.edu

Robert Hetland wrote:

ax.set_axisbelow(True)

Is there a way to set this in the rc file? axisbelow(True) would be my default preference.

-Rob.

The rc file is already pretty big--we might instead consider making axisbelow(True) the hardwired default. It seems logical to me. It would be good to hear from others--are there people who like the present default and/or prefer adding this option to the rc collection?

Looking at the code a little more, I wonder whether the best way to handle this might not be by taking advantage of zorder more consistently. I think we could spread out the default zorders, assign a suitable zorder to the axis artists, add those artists to the artists list in the axes.draw method, and then let the zorder take care of the rest automatically. This way we could ensure a logical default order: image, all patch-like things, axis grids, all line-like things; and if anyone wanted to change the order, it could be done easily via setting selected zorder values. If necessary, convenience functions could be used for setting zorder without the user having to know which numerical values were assigned for which types of object.

I think this could make the code and interface simpler, more self-consistent, and more flexible. (My remarks are based on only a quick look, so I may be missing something important.)

Eric

···

On May 7, 2006, at 11:15 PM, Vineet Jain wrote: