|
From: Joe K. <jof...@gm...> - 2013-04-15 11:57:54
|
> Apart from implementing this natively in matplotlib, I was thinking if > I could work around this limitation for our purposes in the following > way: My objects to draw will always sit in a Collection. I could derive > my own Collection class with a draw() method that changes the > linewidth of the collections, taking into account the current > axes.transData and figure.dpi. Using that I should be able to > achieve my goal, right? (given that I restrict myself to plots with > the same scaling in all directions) > > Not to plug one of my own answers, but there's an example of using a callback to keep linewidths in data coordinates here: http://stackoverflow.com/a/15673254/325565 Have a look at the second example in the answer for the callback approach. Using something like ``shapely`` to buffer your lines as the first example does is also an option. Hope that helps a bit anyway, -Joe |