From: John H. <jdh...@ac...> - 2005-04-08 14:58:09
|
>>>>> "Travis" == Travis Brady <td...@fa...> writes: Travis> Hi John, I've finally gotten to the point where I'm making Travis> really nice plots on the fly in a bit of code I wrote that Travis> I call from within the analysis part of my code and I must Travis> say, Matplotlib rules. Great -- glad it's starting to work for you. In the future, could you post to the list instead of me directly. That way the responses show up in the archives, and others can provide help as well Travis> But there are a few things that I always find difficult. Travis> Most of the time the legend is a good bit larger than I'd Travis> like and I can't seem to figure out how to change that, Travis> though I'm thinking it probably involves something like Travis> what you do in legend_demo.py in the examples. Is this Travis> true, getting the text and then setting its fontsize? and Travis> then setting the width and height of the frame? Yes, you can control the size of the text following the example from examples/legend_demo.py. There are a few other parameters to tweak as well, eg the following kwargs to the legend command numpoints = 4 # the number of points in the legend line fontprop = ... # the font property pad = 0.2 # the fractional whitespace inside the legend border markerscale = 0.6 # the relative size of legend markers vs. original labelsep = 0.005 # the vertical space between the legend entries handlelen = 0.05 # the length of the legend lines handletextsep = 0.02 # the space between the legend line and legend text axespad = 0.02 # the border between the axes and legend edge Setting the width and height of the frame directly probably won't help, as this is dynamically resized at drawing time to accommodate the artists contained inside it. Travis> Also, I'm making a plot of some signed errors and for some Travis> reason the y axis seems broken as the negative values are Travis> being plotting above the positive ones, any idea why this Travis> might be? I haven't seen anything like this before. An example which shows the bug would help, as would the version info provided when you run your script with --verbose-helpful. JDH |