From: Alan G I. <ala...@gm...> - 2010-09-17 12:23:33
|
http://matplotlib.sourceforge.net/examples/pylab_examples/accented_text.html hth, Alan Isaac |
From: Russell E. O. <ro...@uw...> - 2010-09-22 17:04:58
|
In article <4C9...@gm...>, Alan G Isaac <ala...@gm...> wrote: > http://matplotlib.sourceforge.net/examples/pylab_examples/accented_text.html It's realistic, and that has a lot to be said for it. One of my problems with matplotlib is that it is far too willing to truncate axis labels and related information. I'd be much happier with a layout model that always showed the axis labels in full. -- Russell |
From: Benjamin R. <ben...@ou...> - 2010-09-22 18:17:20
|
On Wed, Sep 22, 2010 at 12:04 PM, Russell E. Owen <ro...@uw...> wrote: > In article <4C9...@gm...>, > Alan G Isaac <ala...@gm...> > wrote: > > > > http://matplotlib.sourceforge.net/examples/pylab_examples/accented_text.html > > It's realistic, and that has a lot to be said for it. > > One of my problems with matplotlib is that it is far too willing to > truncate axis labels and related information. I'd be much happier with a > layout model that always showed the axis labels in full. > > -- Russell > > Ditto on this. In addition, it would be useful to prevent axes labels from spilling over into another axes' area. Ben Root |
From: Russell O. <ro...@uw...> - 2010-09-22 20:12:25
|
On Sep 22, 2010, at 11:16 AM, Benjamin Root wrote: > On Wed, Sep 22, 2010 at 12:04 PM, Russell E. Owen <ro...@uw...> > wrote: > In article <4C9...@gm...>, > Alan G Isaac <ala...@gm...> > wrote: > > > http://matplotlib.sourceforge.net/examples/pylab_examples/accented_text.html > > It's realistic, and that has a lot to be said for it. > > One of my problems with matplotlib is that it is far too willing to > truncate axis labels and related information. I'd be much happier > with a > layout model that always showed the axis labels in full. > > Ditto on this. In addition, it would be useful to prevent axes > labels from spilling over into another axes' area. I submitted bug report #3073546 on the issue of axis labels getting truncated. https://sourceforge.net/tracker/?func=detail&atid=560720&aid=3073546&group_id=80706 You might want to add your suggestion about axis labels or submit a new ticket. Regards, -- Russell |
From: Eric F. <ef...@ha...> - 2010-09-22 22:16:49
|
On 09/22/2010 10:11 AM, Russell Owen wrote: > On Sep 22, 2010, at 11:16 AM, Benjamin Root wrote: > >> On Wed, Sep 22, 2010 at 12:04 PM, Russell E. Owen <ro...@uw... >> <mailto:ro...@uw...>> wrote: >> >> In article <4C9...@gm... >> <mailto:4C9...@gm...>>, >> Alan G Isaac <ala...@gm... <mailto:ala...@gm...>> >> wrote: >> >> > >> http://matplotlib.sourceforge.net/examples/pylab_examples/accented_text.html >> >> It's realistic, and that has a lot to be said for it. >> >> One of my problems with matplotlib is that it is far too willing to >> truncate axis labels and related information. I'd be much happier >> with a >> layout model that always showed the axis labels in full. >> >> >> Ditto on this. In addition, it would be useful to prevent axes labels >> from spilling over into another axes' area. > > I submitted bug report #3073546 on the issue of axis labels getting > truncated. > https://sourceforge.net/tracker/?func=detail&atid=560720&aid=3073546&group_id=80706 > <https://sourceforge.net/tracker/?func=detail&atid=560720&aid=3073546&group_id=80706> > > You might want to add your suggestion about axis labels or submit a new > ticket. The problem is not a bug; it is inherent in the fundamental design. Therefore I moved the ticket over to feature requests. I want to keep the bugs list for real bugs that we can realistically expect to solve fairly quickly. I don't know whether Andrew Straw's wx sizer-inspired code (mplsizer toolkit) solves the problem or not. My impression is that it does not--I think it is working with the Axes positions, not with axis and tick labels, which are what cause most of the difficulties. Eric > > Regards, > > -- Russell > > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: C M <cmp...@gm...> - 2010-09-23 01:32:25
|
On Wed, Sep 22, 2010 at 6:16 PM, Eric Firing <ef...@ha...> wrote: > On 09/22/2010 10:11 AM, Russell Owen wrote: >> On Sep 22, 2010, at 11:16 AM, Benjamin Root wrote: >> >>> On Wed, Sep 22, 2010 at 12:04 PM, Russell E. Owen <ro...@uw... >>> <mailto:ro...@uw...>> wrote: >>> >>> In article <4C9...@gm... >>> <mailto:4C9...@gm...>>, >>> Alan G Isaac <ala...@gm... <mailto:ala...@gm...>> >>> wrote: >>> >>> > >>> http://matplotlib.sourceforge.net/examples/pylab_examples/accented_text.html >>> >>> It's realistic, and that has a lot to be said for it. >>> >>> One of my problems with matplotlib is that it is far too willing to >>> truncate axis labels and related information. I'd be much happier >>> with a >>> layout model that always showed the axis labels in full. >>> >>> >>> Ditto on this. In addition, it would be useful to prevent axes labels >>> from spilling over into another axes' area. >> >> I submitted bug report #3073546 on the issue of axis labels getting >> truncated. >> https://sourceforge.net/tracker/?func=detail&atid=560720&aid=3073546&group_id=80706 >> <https://sourceforge.net/tracker/?func=detail&atid=560720&aid=3073546&group_id=80706> >> >> You might want to add your suggestion about axis labels or submit a new >> ticket. > > The problem is not a bug; it is inherent in the fundamental design. > Therefore I moved the ticket over to feature requests. I want to keep > the bugs list for real bugs that we can realistically expect to solve > fairly quickly. > > I don't know whether Andrew Straw's wx sizer-inspired code (mplsizer > toolkit) solves the problem or not. My impression is that it does > not--I think it is working with the Axes positions, not with axis and > tick labels, which are what cause most of the difficulties. > > Eric 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 |
From: John H. <jd...@gm...> - 2010-09-23 12:48:13
|
On Wed, Sep 22, 2010 at 8:31 PM, C M <cmp...@gm...> 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. Change your subplots adjust parameters to make the default bottom, left, wspace and hspace wider. This will reduce the chance of overlaps. http://matplotlib.sourceforge.net/search.html?q=subplots_adjust The defaults can be changed in your rc file http://matplotlib.sourceforge.net/users/customizing.html See also these recipes on the FAQ to automatically choose boundaries http://matplotlib.sourceforge.net/faq/howto_faq.html#move-the-edge-of-an-axes-to-make-room-for-tick-labels http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels Automatic layout to avoid overlap is not an easy problem -- Michael Droetboom worked on it for a while but didn't get to a satisfactory point. So far our philosophy has been : make it easy to customize rather than do it automatically. I realize this is not always a good approach, especially in automated figure generators where you don't have access to the data ahead of time. JDH |
From: Jae-Joon L. <lee...@gm...> - 2010-09-30 11:55:31
Attachments:
make_room_for_ylabel_using_axesgrid.py
|
On Thu, Sep 23, 2010 at 10:31 AM, C M <cmp...@gm...> 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/mat...@li.../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 |
From: C M <cmp...@gm...> - 2010-12-14 19:13:40
|
On Thu, Sep 30, 2010 at 7:55 AM, Jae-Joon Lee <lee...@gm...> wrote: > On Thu, Sep 23, 2010 at 10:31 AM, C M <cmp...@gm...> 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/mat...@li.../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 |
From: C M <cmp...@gm...> - 2011-05-09 18:06:50
|
On Thu, Sep 30, 2010 at 7:55 AM, Jae-Joon Lee <lee...@gm...> wrote: > On Thu, Sep 23, 2010 at 10:31 AM, C M <cmp...@gm...> 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/mat...@li.../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. > Although this has been a big improvement, there is a lingering issue that I want to get around to cleaning up now. When I use this workaround that Jae Joon provided, it works just fine except that if I call canvas.draw() (because I am adding a star to a particular marker when point picking), it causes the whole canvas to "jump" a little bit. What happens is that on the first call to .draw() the plot area increases vertically a tiny amount and the title moves up slightly. On subsequent calls, the plot surface doesn't increase vertically but the title text moves slightly up and then down quickly. This happens each time I point pick for the first 5 or so times, and then it stops doing it. I don't even have to add any new points to the plot, just call canvas.draw() and it will do this. It is visually distracting and a look and feel demerit for the app for sure. I've tried to make a sample that is not embedded in wxPython but so far I can't reproduce the problem. Jae Joon or anyone, any ideas about why this is occurring and how to prevent it? If need be I will try to work up a sample that demonstrates it, but so far I've failed in that. Thanks, Che |
From: Jae-Joon L. <lee...@gm...> - 2011-05-11 04:30:11
|
I think I fixed a similar bug at some point but I'm not sure if that is related with this. Are you using the *make_axes_area_auto_adjustable* from the current git master (check examples/axes_grid/make_room_for_ylabel_using_axesgrid.py)? If not can you try that? Also please post your code. Regards, -JJ On Tue, May 10, 2011 at 3:06 AM, C M <cmp...@gm...> wrote: > On Thu, Sep 30, 2010 at 7:55 AM, Jae-Joon Lee <lee...@gm...> wrote: >> On Thu, Sep 23, 2010 at 10:31 AM, C M <cmp...@gm...> 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/mat...@li.../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. >> > > Although this has been a big improvement, there is a lingering issue > that I want to get around to cleaning up now. > > When I use this workaround that Jae Joon provided, it works just fine > except that if I call canvas.draw() (because I am adding a star to a > particular marker when point picking), it causes the whole canvas to > "jump" a little bit. > > What happens is that on the first call to .draw() the plot area > increases vertically a tiny amount and the title moves up slightly. > On subsequent calls, the plot surface doesn't increase vertically but > the title text moves slightly up and then down quickly. This happens > each time I point pick for the first 5 or so times, and then it stops > doing it. I don't even have to add any new points to the plot, just > call canvas.draw() and it will do this. > > It is visually distracting and a look and feel demerit for the app for sure. > > I've tried to make a sample that is not embedded in wxPython but so > far I can't reproduce the problem. > > Jae Joon or anyone, any ideas about why this is occurring and how to > prevent it? If need be I will try to work up a sample that > demonstrates it, but so far I've failed in that. > > Thanks, > Che > |
From: C M <cmp...@gm...> - 2011-05-11 15:08:18
|
On Wed, May 11, 2011 at 11:07 AM, C M <cmp...@gm...> wrote: > On Wed, May 11, 2011 at 12:29 AM, Jae-Joon Lee <lee...@gm...> wrote: >> I think I fixed a similar bug at some point but I'm not sure if that >> is related with this. >> Are you using the *make_axes_area_auto_adjustable* from the current >> git master (check >> examples/axes_grid/make_room_for_ylabel_using_axesgrid.py)? If not can >> you try that? Also please post your code. > I have not set up with git since Matplotlib made the change from svn. I just downloaded git to get started but don't know how to use it yet; for now is there a way to just check out the files I need to test this, or is there some other (non-git) way to get this update? Thanks, Che |
From: Michael D. <md...@st...> - 2011-05-12 17:28:33
|
You can always get a tarball of the current git master by going here: https://github.com/matplotlib/matplotlib clicking on "Download" and choosing one of the "download source" options at the top of the popup box. Mike On 05/11/2011 11:07 AM, C M wrote: > On Wed, May 11, 2011 at 11:07 AM, C M<cmp...@gm...> wrote: > >> On Wed, May 11, 2011 at 12:29 AM, Jae-Joon Lee<lee...@gm...> wrote: >> >>> I think I fixed a similar bug at some point but I'm not sure if that >>> is related with this. >>> Are you using the *make_axes_area_auto_adjustable* from the current >>> git master (check >>> examples/axes_grid/make_room_for_ylabel_using_axesgrid.py)? If not can >>> you try that? Also please post your code. >>> >> > I have not set up with git since Matplotlib made the change from svn. > I just downloaded git to get started but don't know how to use it yet; > for now is there a way to just check out the files I need to test > this, or is there some other (non-git) way to get this update? > > Thanks, > Che > > ------------------------------------------------------------------------------ > Achieve unprecedented app performance and reliability > What every C/C++ and Fortran developer should know. > Learn how Intel has extended the reach of its next-generation tools > to help boost performance applications - inlcuding clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA |
From: C M <cmp...@gm...> - 2011-05-12 18:35:03
|
On Thu, May 12, 2011 at 1:26 PM, Michael Droettboom <md...@st...> wrote: > You can always get a tarball of the current git master by going here: > > https://github.com/matplotlib/matplotlib > > clicking on "Download" and choosing one of the "download source" options > at the top of the popup box. > > Mike Thanks, but I'm having trouble using that. I downloaded the .zip file, unzipped the archive, moved the folder to C:\Python25\Lib\site-packages, renamed my current matplotlib folder to matplotlib_OLD, ran these commands from the new directory: python setup.py build python setup.py install And finally renamed the new folder to just matplotlib. It is not finding the modules when I go to run it. If revert the names of the folders, my old folder still works. What am I doing wrong? Thanks, Che |
From: Michael D. <md...@st...> - 2011-05-12 18:56:38
|
On 05/12/2011 02:34 PM, C M wrote: > On Thu, May 12, 2011 at 1:26 PM, Michael Droettboom<md...@st...> wrote: > >> You can always get a tarball of the current git master by going here: >> >> https://github.com/matplotlib/matplotlib >> >> clicking on "Download" and choosing one of the "download source" options >> at the top of the popup box. >> >> Mike >> > Thanks, but I'm having trouble using that. I downloaded the .zip > file, unzipped the archive, moved the folder to > C:\Python25\Lib\site-packages, renamed my current matplotlib folder to > matplotlib_OLD, ran these commands from the new directory: > > python setup.py build > python setup.py install > > And finally renamed the new folder to just matplotlib. It is not > finding the modules when I go to run it. If revert the names of the > folders, my old folder still works. What am I doing wrong? > You should not expand the directory tree under site-packages -- "python setup.py install" is what does that for you. You should expand it anywhere else (most people create a "src" directory somewhere on their machine for source code). Then run those commands. Cheers, Mike -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA |
From: C M <cmp...@gm...> - 2011-05-12 19:17:09
|
On Thu, May 12, 2011 at 2:50 PM, Michael Droettboom <md...@st...> wrote: > On 05/12/2011 02:34 PM, C M wrote: >> >> On Thu, May 12, 2011 at 1:26 PM, Michael Droettboom<md...@st...> >> wrote: >> >>> >>> You can always get a tarball of the current git master by going here: >>> >>> https://github.com/matplotlib/matplotlib >>> >>> clicking on "Download" and choosing one of the "download source" options >>> at the top of the popup box. >>> >>> Mike >>> >> >> Thanks, but I'm having trouble using that. I downloaded the .zip >> file, unzipped the archive, moved the folder to >> C:\Python25\Lib\site-packages, renamed my current matplotlib folder to >> matplotlib_OLD, ran these commands from the new directory: >> >> python setup.py build >> python setup.py install >> >> And finally renamed the new folder to just matplotlib. It is not >> finding the modules when I go to run it. If revert the names of the >> folders, my old folder still works. What am I doing wrong? >> > > You should not expand the directory tree under site-packages -- "python > setup.py install" is what does that for you. You should expand it anywhere > else (most people create a "src" directory somewhere on their machine for > source code). Then run those commands. I unzipped it in a download directory, changed the directory to that folder, and ran the commands again...and it did not put a matplotlib folder under site-packages. Is there a step-by-step method on the website that shows how to do this? But all I really want is the changes that Jae Joon made as mentioned above. Is there a way to just grab them from the new folders? (I thought not because the folder structure from what I downloaded from git master doesn't match the folder structure I had from mpl 1.0, downloaded from the main mpl page). Thanks, Che |
From: Pauli V. <pa...@ik...> - 2011-05-13 10:23:29
|
Thu, 12 May 2011 15:16:43 -0400, C M wrote: [clip: installing Python modules] > Is there a step-by-step method on the > website that shows how to do this? Here: http://docs.python.org/install/index.html |
From: Johannes R. <JRa...@gm...> - 2011-05-13 12:46:23
|
Hej I want to include a mathematical expression but want to position it outside the graphs box. I want it above the graph, so i tried to set it as title but there is to less space between the title and the graphs box. how can that be done? how to set a position outside the box? I tried eg: plt.title(r'$F(x)=p*\frac{1}{s1\sqrt{2\pi}}$', fontsize=20) thanks /johannes -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone |
From: Johannes R. <JRa...@gm...> - 2011-05-13 14:20:40
|
That is not what I want, to put the text inside the figure. I want the text above the figure with some space (e.g 2 cm) to the figure thats why I tried 0, 1.2 but then the text is outside the margins /j -------- Original-Nachricht -------- > Datum: Fri, 13 May 2011 14:03:16 +0000 (UTC) > Von: Pauli Virtanen <pa...@ik...> > An: mat...@li... > Betreff: Re: [Matplotlib-users] Text outside the graphs "box" > Fri, 13 May 2011 15:58:37 +0200, Johannes Radinger wrote: > > Hello again I tried: > > > > plt.figtext(0, 1.2, r'$F(x)=p*\frac{1}{s1\sqrt{2\pi}}$', fontsize=20) > > > > but then the text is outside the printed area and therefore not > > displayed. Does that mean that the printed area has to be changed as > > well? > > The first two parameters are the x and y coordinates of the text, > in range [0, 1]. Adjust them to put the text inside the figure. > > > ------------------------------------------------------------------------------ > Achieve unprecedented app performance and reliability > What every C/C++ and Fortran developer should know. > Learn how Intel has extended the reach of its next-generation tools > to help boost performance applications - inlcuding clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone |
From: Benjamin R. <ben...@ou...> - 2011-05-13 15:02:15
|
On Friday, May 13, 2011, Johannes Radinger <JRa...@gm...> wrote: > That is not what I want, to put the text inside the figure. > > I want the text above the figure with some space (e.g 2 cm) to the figure > thats why I tried 0, 1.2 but then the text is outside the margins > "figure" is the term for the entire printable space. The graphs that are made in a figure are called "plots". figtext() lets you put text anywhere you want in the normalized domain of 0 to 1. If you want the text exactly in the middle, the specify 0.5, 0.5. Want it in a corner, then you can do 0.0, 1.0. Figtext is what you want. Ben Root |
From: Michael D. <md...@st...> - 2011-05-13 15:03:59
|
I think there's a confusion of definition here: figure: The entire image axes: A box within the figure containing a plot Mike On 05/13/2011 10:20 AM, Johannes Radinger wrote: > That is not what I want, to put the text inside the figure. > > I want the text above the figure with some space (e.g 2 cm) to the figure > thats why I tried 0, 1.2 but then the text is outside the margins > > /j > -------- Original-Nachricht -------- > >> Datum: Fri, 13 May 2011 14:03:16 +0000 (UTC) >> Von: Pauli Virtanen<pa...@ik...> >> An: mat...@li... >> Betreff: Re: [Matplotlib-users] Text outside the graphs "box" >> > >> Fri, 13 May 2011 15:58:37 +0200, Johannes Radinger wrote: >> >>> Hello again I tried: >>> >>> plt.figtext(0, 1.2, r'$F(x)=p*\frac{1}{s1\sqrt{2\pi}}$', fontsize=20) >>> >>> but then the text is outside the printed area and therefore not >>> displayed. Does that mean that the printed area has to be changed as >>> well? >>> >> The first two parameters are the x and y coordinates of the text, >> in range [0, 1]. Adjust them to put the text inside the figure. >> >> >> ------------------------------------------------------------------------------ >> Achieve unprecedented app performance and reliability >> What every C/C++ and Fortran developer should know. >> Learn how Intel has extended the reach of its next-generation tools >> to help boost performance applications - inlcuding clusters. >> http://p.sf.net/sfu/intel-dev2devmay >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA |
From: C M <cmp...@gm...> - 2011-05-13 17:46:49
|
On Fri, May 13, 2011 at 6:23 AM, Pauli Virtanen <pa...@ik...> wrote: > Thu, 12 May 2011 15:16:43 -0400, C M wrote: > [clip: installing Python modules] >> Is there a step-by-step method on the >> website that shows how to do this? > > Here: http://docs.python.org/install/index.html Thanks, but I guess I can't install matplotlib since I can't build it, since I don't have VS2003. |
From: C M <cmp...@gm...> - 2011-05-13 18:36:59
|
On Wed, May 11, 2011 at 12:29 AM, Jae-Joon Lee <lee...@gm...> wrote: > I think I fixed a similar bug at some point but I'm not sure if that > is related with this. > Are you using the *make_axes_area_auto_adjustable* from the current > git master (check > examples/axes_grid/make_room_for_ylabel_using_axesgrid.py)? If not can > you try that? Also please post your code. It seems I can't build matplotlib from source. Would it be possible to attach the amended files to this list and I'll try them? Thank you, Che |
From: Christopher B. <Chr...@no...> - 2010-09-22 19:29:03
|
Benjamin Root wrote: > On Wed, Sep 22, 2010 at 12:04 PM, Russell E. Owen <ro...@uw... > I'd be much happier with a > Ditto on this. In addition, it would be useful to prevent axes labels > from spilling over into another axes' area. Someone was working on a wxSizer-like layout tool for MPL -- anyone know what happened to that? Also -- do all MPL artists (text, etc) know enough about how big they are to do this at all? I recall trying to do a bit myself, and had a hard time finding out how big a label was, and thus didn't know where to put an axis so the label wouldn't be chopped off. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Benjamin R. <ben...@ou...> - 2010-09-22 20:05:22
|
On Wed, Sep 22, 2010 at 2:28 PM, Christopher Barker <Chr...@no...>wrote: > Benjamin Root wrote: > > On Wed, Sep 22, 2010 at 12:04 PM, Russell E. Owen <ro...@uw... > > I'd be much happier with a > > > Ditto on this. In addition, it would be useful to prevent axes labels > > from spilling over into another axes' area. > > Someone was working on a wxSizer-like layout tool for MPL -- anyone know > what happened to that? > > Also -- do all MPL artists (text, etc) know enough about how big they > are to do this at all? I recall trying to do a bit myself, and had a > hard time finding out how big a label was, and thus didn't know where to > put an axis so the label wouldn't be chopped off. > > -Chris > > I think the issue was that it could not be generalized that an artist knows its size until it comes time to render. I think the main culprit here is text labels (particularly latex stuff). If it could be known what an artist's size is when the artist is made, then I think a lot of code could be simplified because all artists would reference itself relative to their parent artist (think particularly how axes and figure objects have size properties). Although, as a counter-point, we don't want to inhibit a user's ability to have something outside of its parents (annotations, arrows and such). Maybe most artists would have a property indicating whether it should be constrained or not. Now that I think about it even more, doing a proper layout engine would be a headache... Ben Root |