SourceForge logo
SourceForge logo
Menu

[matplotlib-devel] legend class with paddings in canvas unit

From: Jae-Joon L. <lee...@gm...> - 2008年10月30日 07:59:19
Attachments: legend_test.jpg
Hello,
I have been putting some initial effort on implementing a new Legend
class which has paddings in canvas unit.
A related post is
http://www.mail-archive.com/mat...@li.../msg08560.html
My current implementation has a same functionality as the old one (an
example figure attached), but I haven't implemented a new features
like multicolumn option yet.
Basic idea is to create a new version of the Legend class with a same
interface to the current one.
Eric's original suggestion was to use some optional kwarg to choose the version.
But I found this approach does not work well unless we also set the
meaningful default values in the rc file. For example, the current
"legend.axespad" in rcsetup.py is 0.02 which is in axes unit. But this
need to be ~10 (if given in points) or ~0.5 (if given in fraction of
the font size) in the new class.
One option I can think of is a work flow something like below.
 import matplotlib.legend
 matplotlib.legend.use_newclass(True) # this simply override the
rcParam with new default values and bind legend.Legend to the new
class.
 # do some stuff
 matplotlib.legend.use_newclass(False) # recover the original
rcParam and rebind legend.Legend back to the original class
So, how do others think?
Any idea or suggestion is welcomed.
Regards,
-JJ

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /