I've attached a small demo code that solves a problem I was having; when the grid for the major and minor ticks are both drawn, the minor grid is drawn over the top of the major grid. This can make the grid at the majors look a little messy. The same thing was happening for the ticks as well; minor ticks are drawn on top of major.
I'm hoping that someone will find the attached code useful, and also that it might make its way into matplotlib. The "set_superior_locator" function in the attached code would be a very natural fit inside the Locator class as a member function, with hardly any modification. All the set_superior_locator() function does is to inject itself into the Locator object, so that it gets a chance to cull out locations that are duplicated between it and its "superior" locator. The main use of this is to tell a minor locator who the major locator is, so that the minor locator will not draw ticks and/or grid lines on top of places where the major locator has already done it. If you run the script attached, it will pop two plots (close one to see the other); one with default drawing, and the second with the culling of grid lines and tick marks. I know that the colors and thicknesses that I chose are ugly, but they do illustrate the point ;) -- Daniel Hyams dhy...@gmail.com
griddemo.py
Description: Binary data
------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users