From: Vineet J. <vin...@ya...> - 2006-05-04 16:03:13
|
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 |
From: Eric F. <ef...@ha...> - 2006-05-04 17:11:35
|
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 |
From: Vineet J. <vin...@ya...> - 2006-05-08 04:15:33
|
> ax.set_axisbelow(True) Thanks a lot. That fixed the problem. VJ |
From: Robert H. <he...@ta...> - 2006-05-08 14:01:02
|
On May 7, 2006, at 11:15 PM, Vineet Jain wrote: > >> ax.set_axisbelow(True) Is there a way to set this in the rc file? axisbelow(True) would be my default preference. -Rob. ----- Rob Hetland, Assistant Professor Dept of Oceanography, Texas A&M University p: 979-458-0096, f: 979-845-6331 e: he...@ta..., w: http://pong.tamu.edu |
From: Eric F. <ef...@ha...> - 2006-05-08 17:42:46
|
Robert Hetland wrote: > > On May 7, 2006, at 11:15 PM, Vineet Jain 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 |
From: John H. <jdh...@ac...> - 2006-05-08 17:49:31
|
>>>>> "Eric" == Eric Firing <ef...@ha...> writes: Eric> The rc file is already pretty big--we might instead consider Eric> making axisbelow(True) the hardwired default. It seems I already committed this change, but your comments on bloating rc files are well taken. Eric> logical to me. It would be good to hear from others--are Eric> there people who like the present default and/or prefer Eric> adding this option to the rc collection? Eric> Looking at the code a little more, I wonder whether the best Eric> way to handle this might not be by taking advantage of Eric> zorder more consistently. I think we could spread out the Eric> default zorders, assign a suitable zorder to the axis They don't need to be spread out per say, since these are floats we can subdivide them ad nauseaum. Helper functions would make this more intuitive, like myobj.set_zorder(zhelper.between(gridline, myline)) Eric> I think this could make the code and interface simpler, more Eric> self-consistent, and more flexible. (My remarks are based Eric> on only a quick look, so I may be missing something Eric> important.) But people will still want to set defaults... JDH |
From: Eric F. <ef...@ha...> - 2006-05-08 18:28:08
|
John Hunter wrote: >>>>>>"Eric" == Eric Firing <ef...@ha...> writes: > > > Eric> The rc file is already pretty big--we might instead consider > Eric> making axisbelow(True) the hardwired default. It seems > > I already committed this change, but your comments on bloating rc > files are well taken. > > Eric> logical to me. It would be good to hear from others--are > Eric> there people who like the present default and/or prefer > Eric> adding this option to the rc collection? > > Eric> Looking at the code a little more, I wonder whether the best > Eric> way to handle this might not be by taking advantage of > Eric> zorder more consistently. I think we could spread out the > Eric> default zorders, assign a suitable zorder to the axis > > They don't need to be spread out per say, since these are floats we > can subdivide them ad nauseaum. Helper functions would make this more > intuitive, like > > myobj.set_zorder(zhelper.between(gridline, myline)) Agreed. Unless someone else would like to do it, I think I can work on this fairly soon, before or after I finish the work I am doing now on a new colorbar. > > Eric> I think this could make the code and interface simpler, more > Eric> self-consistent, and more flexible. (My remarks are based > Eric> on only a quick look, so I may be missing something > Eric> important.) > > But people will still want to set defaults... Granted, and this flexibility is good. Eric |