another incorrectly clipped PNG in the gallery

I’m using it too, with excellent results. Thanks JJ!

···

On Tue, Dec 14, 2010 at 2:13 PM, C M <cmpython@…287…> wrote:

On Thu, Sep 30, 2010 at 7:55 AM, Jae-Joon Lee <lee.j.joon@…287…> wrote:

On Thu, Sep 23, 2010 at 10:31 AM, C M <cmpython@…287…> wrote:

Until a more permanent solution is figured out, can anyone recommend

any workarounds, even if they are a little clunky? I’m embedding mpl

plots in wxPython and am also finding this issue suboptimal.

Che

A (partial) workaround is possible using the axes_grid1 toolkit (i.e.,

you need matplotlib 1.0).

Attached is a module I just cooked up (based on my previous attempt @

http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg18129.html),

and it seems to work quite well.

The usage is simple.

    ax = plt.axes([0,0,1,1])



    ax.set_yticks([0.5])

    ax.set_yticklabels(["very long label"])



    make_axes_area_auto_adjustable(ax) # This is where axes_grid1 comes in

Then, the axes area(including ticklabels and axis label) will be

automatically adjusted to fit in the given extent ([0, 0, 1, 1] in the

above case).

While this is mainly for a single axes plot, you may use it with

multi-axes plot (but somewhat trickier to use). A few examples are

included in the module.

Regards,

-JJ

This thread is a few months old now, but I just wanted to mention that I am using JJ’s workaround (thanks!) in my app–with either one or two y axes–and it is just excellent.

This should definitely be at least an option for matplotlib users–the quality of the appearance of the plots now is like night and day, because, to me, seeing a plot without its axes labels (I’m talking about in a resizable plot embedded in an application, not a static graph for inclusion in a publication) is a major look and feel demerit.

Che


Lotusphere 2011

Register now for Lotusphere 2011 and learn how

to connect the dots, take your collaborative environment

to the next level, and enter the era of Social Business.

http://p.sf.net/sfu/lotusphere-d2d


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Daniel Hyams
dhyams@…287…


Daniel Hyams
dhyams@…287…

Glad to hear that others find that code useful.
I just want to emphasize that this is not a general solution and never meant to.
Although I'm planning to include this functionality into the
axes_grid1 toolkit, I don't think this will be integrated with the
main matplolib.

Regards,

-JJ

···

On Wed, Dec 15, 2010 at 4:24 AM, Daniel Hyams <dhyams@...287...> wrote:

I'm using it too, with excellent results. Thanks JJ!

On Tue, Dec 14, 2010 at 2:13 PM, C M <cmpython@...287...> wrote:

On Thu, Sep 30, 2010 at 7:55 AM, Jae-Joon Lee <lee.j.joon@...287...> >>> wrote:

On Thu, Sep 23, 2010 at 10:31 AM, C M <cmpython@...287...> wrote:
> Until a more permanent solution is figured out, can anyone recommend
> any workarounds, even if they are a little clunky? I'm embedding mpl
> plots in wxPython and am also finding this issue suboptimal.
>
> Che
>

A (partial) workaround is possible using the axes_grid1 toolkit (i.e.,
you need matplotlib 1.0).
Attached is a module I just cooked up (based on my previous attempt @

Re: [Matplotlib-users] Hints on sizing plot elements?),
and it seems to work quite well.
The usage is simple.

   ax = plt\.axes\(\[0,0,1,1\]\)

   ax\.set\_yticks\(\[0\.5\]\)
   ax\.set\_yticklabels\(\[&quot;very long label&quot;\]\)

   make\_axes\_area\_auto\_adjustable\(ax\) \# This is where axes\_grid1

comes in

Then, the axes area(including ticklabels and axis label) will be
automatically adjusted to fit in the given extent ([0, 0, 1, 1] in the
above case).

While this is mainly for a single axes plot, you may use it with
multi-axes plot (but somewhat trickier to use). A few examples are
included in the module.

Regards,

-JJ

This thread is a few months old now, but I just wanted to mention that I
am using JJ's workaround (thanks!) in my app--with either one or two y
axes--and it is just excellent.

This should definitely be at least an option for matplotlib users--the
quality of the appearance of the plots now is like night and day, because,
to me, seeing a plot without its axes labels (I'm talking about in a
resizable plot embedded in an application, not a static graph for inclusion
in a publication) is a *major* look and feel demerit.

Che

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

--
Daniel Hyams
dhyams@...287...

--
Daniel Hyams
dhyams@...287...

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options