You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
1
(4) |
2
(17) |
3
(9) |
4
(5) |
5
(5) |
6
(2) |
7
|
8
(7) |
9
(6) |
10
(1) |
11
(4) |
12
(12) |
13
(7) |
14
(1) |
15
|
16
|
17
(12) |
18
(11) |
19
(6) |
20
(6) |
21
(2) |
22
(5) |
23
(1) |
24
(4) |
25
(6) |
26
(3) |
27
(2) |
28
|
29
(2) |
30
(12) |
31
(8) |
|
|
|
From: K.-Michael A. <kmi...@gm...> - 2013-07-31 21:45:14
|
On 2013-07-31 16:51:44 +0000, Jeffrey Spencer said: > You can try fig.canvas.draw() to draw but as I have never tried the > above not sure whether it will work. Also this one does not show anything, which makes me start to believe that the axes[0,0].set_axes(ax) could be the step that fails? > > Cheers > > > On Tue, Jul 30, 2013 at 10:13 AM, K.-Michael Aye > <kmi...@gm...> wrote: > Hi! > > Is there a way to copy an axes object into different figures? > The idea would be to first create a valuable plot, save it on its own > into a file, and then add it to a subplots figure as part of an > overview? > I tried to play with this but can't make it to show up in an pylab session: > > plot(arange(10)) > ax = gca() > > fig, axes = subplots(2,2) > > axes[0,0].set_axes(ax) > > If the above is correct, how can I make it show up now? fig.show() did > not work and fig.draw() needs an artist and a renderer which I am > unsure where to get them from? > > Any hints, or which docs to read as usual apprectiated! > Michael > > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: K.-Michael A. <kmi...@gm...> - 2013-07-31 21:40:13
|
On 2013-07-31 17:02:12 +0000, Jeffrey Spencer said: > Should have mentioned but the artist is like self in most classes so > really just need to pass in the renderer. > > The renderer can be obtained from fig.canvas.get_renderer() so can pass > this to fig.draw(fig.canvas.get_renderer()). I have never done it this > way but should have the same results I am guessing as what I mentioned > above. There was no error message, but nothing showed up either. > > Cheers > > > On Tue, Jul 30, 2013 at 10:13 AM, K.-Michael Aye > <kmi...@gm...> wrote: > Hi! > > Is there a way to copy an axes object into different figures? > The idea would be to first create a valuable plot, save it on its own > into a file, and then add it to a subplots figure as part of an > overview? > I tried to play with this but can't make it to show up in an pylab session: > > plot(arange(10)) > ax = gca() > > fig, axes = subplots(2,2) > > axes[0,0].set_axes(ax) > > If the above is correct, how can I make it show up now? fig.show() did > not work and fig.draw() needs an artist and a renderer which I am > unsure where to get them from? > > Any hints, or which docs to read as usual apprectiated! > Michael > > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Jeffrey S. <jef...@gm...> - 2013-07-31 17:02:36
|
Should have mentioned but the artist is like self in most classes so really just need to pass in the renderer. The renderer can be obtained from fig.canvas.get_renderer() so can pass this to fig.draw(fig.canvas.get_renderer()). I have never done it this way but should have the same results I am guessing as what I mentioned above. Cheers On Tue, Jul 30, 2013 at 10:13 AM, K.-Michael Aye <kmi...@gm...>wrote: > Hi! > > Is there a way to copy an axes object into different figures? > The idea would be to first create a valuable plot, save it on its own > into a file, and then add it to a subplots figure as part of an > overview? > I tried to play with this but can't make it to show up in an pylab session: > > plot(arange(10)) > ax = gca() > > fig, axes = subplots(2,2) > > axes[0,0].set_axes(ax) > > If the above is correct, how can I make it show up now? fig.show() did > not work and fig.draw() needs an artist and a renderer which I am > unsure where to get them from? > > Any hints, or which docs to read as usual apprectiated! > Michael > > > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Jeffrey S. <jef...@gm...> - 2013-07-31 16:52:08
|
You can try fig.canvas.draw() to draw but as I have never tried the above not sure whether it will work. Cheers On Tue, Jul 30, 2013 at 10:13 AM, K.-Michael Aye <kmi...@gm...>wrote: > Hi! > > Is there a way to copy an axes object into different figures? > The idea would be to first create a valuable plot, save it on its own > into a file, and then add it to a subplots figure as part of an > overview? > I tried to play with this but can't make it to show up in an pylab session: > > plot(arange(10)) > ax = gca() > > fig, axes = subplots(2,2) > > axes[0,0].set_axes(ax) > > If the above is correct, how can I make it show up now? fig.show() did > not work and fig.draw() needs an artist and a renderer which I am > unsure where to get them from? > > Any hints, or which docs to read as usual apprectiated! > Michael > > > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Jeffrey S. <jef...@gm...> - 2013-07-31 15:17:38
|
Yeah, I plot to pcolor a lot but haven't recently so next time I do I'll check. It would make a lot of sense for saving overhead there as you have stated. The overhead doesn't seem to be to big for small plots but was just curious where it was most useful. Cheers, Jeff On Thu, Aug 1, 2013 at 12:59 AM, Michael Droettboom <md...@st...> wrote: > On 07/31/2013 10:38 AM, Jeffrey Spencer wrote: > > Michael, > > Pdftocairo is a good tool to know so thanks for that tip. > > I still think currently it is a regression with the current 'stamp' > method to use it on all accounts. I understand in a complicated figure with > a bunch of subplots that this would be beneficial and create smaller code. > I don't see how in single figures this would often result in reduced files > sizes. > > > The case where it has an enormous impact is when the same shape is used > multiple times. For example in a scatter, hexbin or pcolor plot. > > > I usually output single figures with one plot and I don't think one of > them that I am currently working on was smaller in 1.4.x. They all resulted > in reduced file sizes with mpl 1.1.1. This figure of 3d spheres resulted in > 60kb instead of roughly 80kb after running pdftocairo. Anyway, you said in > coming versions a threshold should be set before stamping of objects occurs > so a fix is on the way eventually. > > > Yes, but it's too complex of a fix to throw in quickly. I think the > overall benefit of stamping is preferable to not doing it at all at this > point. > > Mike > > > > Thanks for all the help, > Jeff > > > On Wed, Jul 31, 2013 at 11:31 PM, Michael Droettboom <md...@st...>wrote: > >> On 07/30/2013 04:20 PM, Jeffrey Spencer wrote: >> >> Michael, >> >> Thanks that is very informative. Answers most of the problems I was >> having and read MEP14 which looks really useful >> >> That being said does the ps backend subset the fonts or use collections >> for drawing (is the collections feature global or just in the pdf backend)? >> >> >> The ps backend has the same behavior as pdf on both counts. TTF fonts >> are subsetted, but the fonts that come from TeX come to use as Type1 fonts, >> which matplotlib currently does not know how to subset. It also handles >> collections in the same way (by creating a "stamp" and reusing it). >> >> >> I usually use .eps output and convert to pdf using epstopdf unless the >> figure has an alpha channel because always results in a much smaller file >> (60kB roughly for this file or plain figure around 10kB) than direct pdf >> output with the output looking the same. I pretty much always have >> usetex=True so maybe the pdf file is always embedding the full fonts. >> >> >> Yes, when usetex=True, matplotlib does not do any font subsetting (in >> any backend). To get around this limitation, one can use the `pdftocairo` >> tool (part of poppler utils), to convert from pdf to a pdf with subsetted >> fonts. With your example, I was able to get the pdf down to ~80k. With >> MEP14, we would basically move such functionality into matplotlib itself, >> but that's sort of a long term, semi-back-burner project so it could be a >> while. >> >> It's possible that epstopdf is doing some font subsetting of its own. >> But as you point out, Postscript (as a specification) doesn't support >> alpha, so it's not useful when you need alpha. >> >> >> >> Also, does the Cairo backend support usetex=True or subsetting? I know >> I had read it did not support usetex but that was maybe 2 years ago or so. >> The x,y,z axis look correct with cairo but the IPA Fonts don't render >> properly. The legend font says it is size 12 but if you zoom in extremely >> close you can see they are the correct fonts just way to small. The file >> size is around 60kB as well so I am guessing it supports subsetting of >> fonts. >> >> >> Cairo does support font subsetting, but the matplotlib Cairo backend has >> no support for usetex. I'm surprised this worked for you at all. When I >> run your example with the Cairo backend, the IPA characters appear as raw >> TeX source code, i.e. "\textipa{i}", which is what I would expect given >> that the regular font renderer doesn't understand that syntax. >> >> >> >> The pgf backend would also subset fonts if output to .pdf I'm assuming >> because that is the default with pdftex? It results in similar size files >> to the .eps output for this file (roughly 60kB also). >> >> >> Yes. >> >> >> >> The IPA font uses the package (\usepackage{tipa}) and therefore that is >> why I think these look differently. That package draws these fonts with >> its' font libraries instead of whatever is selected as the text font. Maybe >> I'm wrong about this but that is my understanding because even in normal >> latex code the fonts look different than the standard text. >> >> >> That is correct. The default font for usetex=True is Computer Modern, >> whereas it is Bitstream Vera Sans in the default font rendering. I was >> referring to the difference between 1.2 and 1.4 which was using TeX fonts >> in both cases, but due to a bug in 1.3/1.4 was rendering the IPA in serif >> when you had requested sans-serif. >> >> Mike >> >> >> >> Cheers, >> Jeff >> >> >> On Wed, Jul 31, 2013 at 4:43 AM, Michael Droettboom <md...@st...>wrote: >> >>> There are two different things going on here. >>> >>> Between 1.2.1 and now, there was a bugfix to the font selection routine >>> that inadvertently introduced a bug selecting fonts in the usetex backend. >>> You may notice that on master, the IPA font selected is different. The >>> file size difference can be attributed to the slightly larger font size of >>> the one it selected vs. the one it should have. Note that when usetex is >>> True, the fonts are not subsetted, so you always get the full font embedded >>> in the file (MEP14 work will fix this in the future). >>> >>> See b5c340 for the bug that introduced the commit, and >>> https://github.com/matplotlib/matplotlib/pull/2260 for the fix (which >>> should make it into 1.3.0 final). >>> >>> Between 1.1.1 and 1.2.1 a change was made in how collections are >>> handled. Previously, each path was redrawn individually. In 1.2, if a >>> path is reused multiple times, a "stamp" is created and then it is "used" >>> multiple times. In principle, this generally reduces file sizes by a large >>> amount. However, in the case of this figure with the 3D spheres, each path >>> is used only once, so rather than getting the file size savings of that >>> approach, we only get the overhead. The backend could be smarter by not >>> doing this when the path is only used a small number of times. Such a fix >>> would be welcome, but is probably too large/risky to try to get into the >>> current release cycle. It will have to wait for 1.3.1 >>> >>> Cheers, >>> Mike >>> >>> >>> >>> On 07/30/2013 12:24 PM, Jeffrey Spencer wrote: >>> >>> K, I have just made the script self-contained but it loads external data >>> so I have attached that as well. If you want me to just separate out the >>> plotting commands let me know. I have also attached my matplotlib rc file >>> which is the same on all three systems. All the modifications to the >>> matplotlibrc file are copied to the top and in the first 30 lines or so. >>> >>> Of note, the smallest file sizes for pdf are using the pgf backend >>> around 60kb. Not sure if that helps at all. It is also around the same size >>> if I export to .eps and then convert to pdf. About 60kb. The problem with >>> eps in these 3d figures though is the back wall I think has an alpha >>> channel because just becomes a solid wall in the output. No lines through >>> it like the other two walls. >>> >>> >>> On Tue, Jul 30, 2013 at 11:23 PM, Jouni K. Seppänen <jk...@ik...> wrote: >>> >>>> Jeffrey Spencer <jef...@gm...> writes: >>>> >>>> > I have three different versions of matplotlib that all output >>>> different >>>> > file sizes with matplotlib 1.1.1 providing the smallest. This is for >>>> the >>>> > same exact script. I can post the script if that helps. >>>> > >>>> > MPL 1.4.x: 539.32kb, Ubuntu 12.10 >>>> > MPL 1.1.1: 172.56kb Ubuntu 12.10 >>>> > MPL 1.2.1: 475.9kb, Ubuntu 13.04 >>>> >>>> Yes, it would be interesting to know what the plotting commands are. >>>> Just as a guess, since all the sizes are a few hundred kilobytes, it >>>> could be a difference in e.g. font embedding - many TrueType fonts are >>>> of comparable size. >>>> >>>> -- >>>> Jouni K. Seppänen >>>> http://www.iki.fi/jks >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Get your SQL database under version control now! >>>> Version control is standard for application code, but databases havent >>>> caught up. So what steps can you take to put your SQL databases under >>>> version control? Why should you start doing it? Read more to find out. >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Mat...@li... >>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Get your SQL database under version control now! >>> Version control is standard for application code, but databases havent >>> caught up. So what steps can you take to put your SQL databases under >>> version control? Why should you start doing it? Read more to find out.http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>> >>> >>> >>> _______________________________________________ >>> Matplotlib-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Get your SQL database under version control now! >>> Version control is standard for application code, but databases havent >>> caught up. So what steps can you take to put your SQL databases under >>> version control? Why should you start doing it? Read more to find out. >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> >> > > |
From: Michael D. <md...@st...> - 2013-07-31 14:59:21
|
On 07/31/2013 10:38 AM, Jeffrey Spencer wrote: > Michael, > > Pdftocairo is a good tool to know so thanks for that tip. > > I still think currently it is a regression with the current 'stamp' > method to use it on all accounts. I understand in a complicated figure > with a bunch of subplots that this would be beneficial and create > smaller code. I don't see how in single figures this would often > result in reduced files sizes. The case where it has an enormous impact is when the same shape is used multiple times. For example in a scatter, hexbin or pcolor plot. > I usually output single figures with one plot and I don't think one of > them that I am currently working on was smaller in 1.4.x. They all > resulted in reduced file sizes with mpl 1.1.1. This figure of 3d > spheres resulted in 60kb instead of roughly 80kb after running > pdftocairo. Anyway, you said in coming versions a threshold should be > set before stamping of objects occurs so a fix is on the way eventually. Yes, but it's too complex of a fix to throw in quickly. I think the overall benefit of stamping is preferable to not doing it at all at this point. Mike > > Thanks for all the help, > Jeff > > > On Wed, Jul 31, 2013 at 11:31 PM, Michael Droettboom <md...@st... > <mailto:md...@st...>> wrote: > > On 07/30/2013 04:20 PM, Jeffrey Spencer wrote: >> Michael, >> >> Thanks that is very informative. Answers most of the problems I >> was having and read MEP14 which looks really useful >> >> That being said does the ps backend subset the fonts or use >> collections for drawing (is the collections feature global or >> just in the pdf backend)? > > The ps backend has the same behavior as pdf on both counts. TTF > fonts are subsetted, but the fonts that come from TeX come to use > as Type1 fonts, which matplotlib currently does not know how to > subset. It also handles collections in the same way (by creating > a "stamp" and reusing it). > > >> I usually use .eps output and convert to pdf using epstopdf >> unless the figure has an alpha channel because always results in >> a much smaller file (60kB roughly for this file or plain figure >> around 10kB) than direct pdf output with the output looking the >> same. I pretty much always have usetex=True so maybe the pdf file >> is always embedding the full fonts. > > Yes, when usetex=True, matplotlib does not do any font subsetting > (in any backend). To get around this limitation, one can use the > `pdftocairo` tool (part of poppler utils), to convert from pdf to > a pdf with subsetted fonts. With your example, I was able to get > the pdf down to ~80k. With MEP14, we would basically move such > functionality into matplotlib itself, but that's sort of a long > term, semi-back-burner project so it could be a while. > > It's possible that epstopdf is doing some font subsetting of its > own. But as you point out, Postscript (as a specification) > doesn't support alpha, so it's not useful when you need alpha. > > >> >> Also, does the Cairo backend support usetex=True or subsetting? I >> know I had read it did not support usetex but that was maybe 2 >> years ago or so. The x,y,z axis look correct with cairo but the >> IPA Fonts don't render properly. The legend font says it is size >> 12 but if you zoom in extremely close you can see they are the >> correct fonts just way to small. The file size is around 60kB as >> well so I am guessing it supports subsetting of fonts. > > Cairo does support font subsetting, but the matplotlib Cairo > backend has no support for usetex. I'm surprised this worked for > you at all. When I run your example with the Cairo backend, the > IPA characters appear as raw TeX source code, i.e. "\textipa{i}", > which is what I would expect given that the regular font renderer > doesn't understand that syntax. > > >> >> The pgf backend would also subset fonts if output to .pdf I'm >> assuming because that is the default with pdftex? It results in >> similar size files to the .eps output for this file (roughly 60kB >> also). > > Yes. > > >> >> The IPA font uses the package (\usepackage{tipa}) and therefore >> that is why I think these look differently. That package draws >> these fonts with its' font libraries instead of whatever is >> selected as the text font. Maybe I'm wrong about this but that is >> my understanding because even in normal latex code the fonts look >> different than the standard text. > > That is correct. The default font for usetex=True is Computer > Modern, whereas it is Bitstream Vera Sans in the default font > rendering. I was referring to the difference between 1.2 and 1.4 > which was using TeX fonts in both cases, but due to a bug in > 1.3/1.4 was rendering the IPA in serif when you had requested > sans-serif. > > Mike > > >> >> Cheers, >> Jeff >> >> >> On Wed, Jul 31, 2013 at 4:43 AM, Michael Droettboom >> <md...@st... <mailto:md...@st...>> wrote: >> >> There are two different things going on here. >> >> Between 1.2.1 and now, there was a bugfix to the font >> selection routine that inadvertently introduced a bug >> selecting fonts in the usetex backend. You may notice that >> on master, the IPA font selected is different. The file size >> difference can be attributed to the slightly larger font size >> of the one it selected vs. the one it should have. Note that >> when usetex is True, the fonts are not subsetted, so you >> always get the full font embedded in the file (MEP14 work >> will fix this in the future). >> >> See b5c340 for the bug that introduced the commit, and >> https://github.com/matplotlib/matplotlib/pull/2260 for the >> fix (which should make it into 1.3.0 final). >> >> Between 1.1.1 and 1.2.1 a change was made in how collections >> are handled. Previously, each path was redrawn individually. >> In 1.2, if a path is reused multiple times, a "stamp" is >> created and then it is "used" multiple times. In principle, >> this generally reduces file sizes by a large amount. >> However, in the case of this figure with the 3D spheres, each >> path is used only once, so rather than getting the file size >> savings of that approach, we only get the overhead. The >> backend could be smarter by not doing this when the path is >> only used a small number of times. Such a fix would be >> welcome, but is probably too large/risky to try to get into >> the current release cycle. It will have to wait for 1.3.1 >> >> Cheers, >> Mike >> >> >> >> On 07/30/2013 12:24 PM, Jeffrey Spencer wrote: >>> K, I have just made the script self-contained but it loads >>> external data so I have attached that as well. If you want >>> me to just separate out the plotting commands let me know. I >>> have also attached my matplotlib rc file which is the same >>> on all three systems. All the modifications to the >>> matplotlibrc file are copied to the top and in the first 30 >>> lines or so. >>> >>> Of note, the smallest file sizes for pdf are using the pgf >>> backend around 60kb. Not sure if that helps at all. It is >>> also around the same size if I export to .eps and then >>> convert to pdf. About 60kb. The problem with eps in these 3d >>> figures though is the back wall I think has an alpha channel >>> because just becomes a solid wall in the output. No lines >>> through it like the other two walls. >>> >>> >>> On Tue, Jul 30, 2013 at 11:23 PM, Jouni K. Seppänen >>> <jk...@ik... <mailto:jk...@ik...>> wrote: >>> >>> Jeffrey Spencer <jef...@gm... >>> <mailto:jef...@gm...>> writes: >>> >>> > I have three different versions of matplotlib that all >>> output different >>> > file sizes with matplotlib 1.1.1 providing the >>> smallest. This is for the >>> > same exact script. I can post the script if that helps. >>> > >>> > MPL 1.4.x: 539.32kb, Ubuntu 12.10 >>> > MPL 1.1.1: 172.56kb Ubuntu 12.10 >>> > MPL 1.2.1: 475.9kb, Ubuntu 13.04 >>> >>> Yes, it would be interesting to know what the plotting >>> commands are. >>> Just as a guess, since all the sizes are a few hundred >>> kilobytes, it >>> could be a difference in e.g. font embedding - many >>> TrueType fonts are >>> of comparable size. >>> >>> -- >>> Jouni K. Seppänen >>> http://www.iki.fi/jks >>> >>> >>> ------------------------------------------------------------------------------ >>> Get your SQL database under version control now! >>> Version control is standard for application code, but >>> databases havent >>> caught up. So what steps can you take to put your SQL >>> databases under >>> version control? Why should you start doing it? Read >>> more to find out. >>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> <mailto:Mat...@li...> >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Get your SQL database under version control now! >>> Version control is standard for application code, but databases havent >>> caught up. So what steps can you take to put your SQL databases under >>> version control? Why should you start doing it? Read more to find out. >>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>> >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... <mailto:Mat...@li...> >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but >> databases havent >> caught up. So what steps can you take to put your SQL >> databases under >> version control? Why should you start doing it? Read more to >> find out. >> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> <mailto:Mat...@li...> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > |
From: Jeffrey S. <jef...@gm...> - 2013-07-31 14:38:42
|
Michael, Pdftocairo is a good tool to know so thanks for that tip. I still think currently it is a regression with the current 'stamp' method to use it on all accounts. I understand in a complicated figure with a bunch of subplots that this would be beneficial and create smaller code. I don't see how in single figures this would often result in reduced files sizes. I usually output single figures with one plot and I don't think one of them that I am currently working on was smaller in 1.4.x. They all resulted in reduced file sizes with mpl 1.1.1. This figure of 3d spheres resulted in 60kb instead of roughly 80kb after running pdftocairo. Anyway, you said in coming versions a threshold should be set before stamping of objects occurs so a fix is on the way eventually. Thanks for all the help, Jeff On Wed, Jul 31, 2013 at 11:31 PM, Michael Droettboom <md...@st...>wrote: > On 07/30/2013 04:20 PM, Jeffrey Spencer wrote: > > Michael, > > Thanks that is very informative. Answers most of the problems I was > having and read MEP14 which looks really useful > > That being said does the ps backend subset the fonts or use collections > for drawing (is the collections feature global or just in the pdf backend)? > > > The ps backend has the same behavior as pdf on both counts. TTF fonts are > subsetted, but the fonts that come from TeX come to use as Type1 fonts, > which matplotlib currently does not know how to subset. It also handles > collections in the same way (by creating a "stamp" and reusing it). > > > I usually use .eps output and convert to pdf using epstopdf unless the > figure has an alpha channel because always results in a much smaller file > (60kB roughly for this file or plain figure around 10kB) than direct pdf > output with the output looking the same. I pretty much always have > usetex=True so maybe the pdf file is always embedding the full fonts. > > > Yes, when usetex=True, matplotlib does not do any font subsetting (in any > backend). To get around this limitation, one can use the `pdftocairo` tool > (part of poppler utils), to convert from pdf to a pdf with subsetted > fonts. With your example, I was able to get the pdf down to ~80k. With > MEP14, we would basically move such functionality into matplotlib itself, > but that's sort of a long term, semi-back-burner project so it could be a > while. > > It's possible that epstopdf is doing some font subsetting of its own. But > as you point out, Postscript (as a specification) doesn't support alpha, so > it's not useful when you need alpha. > > > > Also, does the Cairo backend support usetex=True or subsetting? I know I > had read it did not support usetex but that was maybe 2 years ago or so. > The x,y,z axis look correct with cairo but the IPA Fonts don't render > properly. The legend font says it is size 12 but if you zoom in extremely > close you can see they are the correct fonts just way to small. The file > size is around 60kB as well so I am guessing it supports subsetting of > fonts. > > > Cairo does support font subsetting, but the matplotlib Cairo backend has > no support for usetex. I'm surprised this worked for you at all. When I > run your example with the Cairo backend, the IPA characters appear as raw > TeX source code, i.e. "\textipa{i}", which is what I would expect given > that the regular font renderer doesn't understand that syntax. > > > > The pgf backend would also subset fonts if output to .pdf I'm assuming > because that is the default with pdftex? It results in similar size files > to the .eps output for this file (roughly 60kB also). > > > Yes. > > > > The IPA font uses the package (\usepackage{tipa}) and therefore that is > why I think these look differently. That package draws these fonts with > its' font libraries instead of whatever is selected as the text font. Maybe > I'm wrong about this but that is my understanding because even in normal > latex code the fonts look different than the standard text. > > > That is correct. The default font for usetex=True is Computer Modern, > whereas it is Bitstream Vera Sans in the default font rendering. I was > referring to the difference between 1.2 and 1.4 which was using TeX fonts > in both cases, but due to a bug in 1.3/1.4 was rendering the IPA in serif > when you had requested sans-serif. > > Mike > > > > Cheers, > Jeff > > > On Wed, Jul 31, 2013 at 4:43 AM, Michael Droettboom <md...@st...>wrote: > >> There are two different things going on here. >> >> Between 1.2.1 and now, there was a bugfix to the font selection routine >> that inadvertently introduced a bug selecting fonts in the usetex backend. >> You may notice that on master, the IPA font selected is different. The >> file size difference can be attributed to the slightly larger font size of >> the one it selected vs. the one it should have. Note that when usetex is >> True, the fonts are not subsetted, so you always get the full font embedded >> in the file (MEP14 work will fix this in the future). >> >> See b5c340 for the bug that introduced the commit, and >> https://github.com/matplotlib/matplotlib/pull/2260 for the fix (which >> should make it into 1.3.0 final). >> >> Between 1.1.1 and 1.2.1 a change was made in how collections are >> handled. Previously, each path was redrawn individually. In 1.2, if a >> path is reused multiple times, a "stamp" is created and then it is "used" >> multiple times. In principle, this generally reduces file sizes by a large >> amount. However, in the case of this figure with the 3D spheres, each path >> is used only once, so rather than getting the file size savings of that >> approach, we only get the overhead. The backend could be smarter by not >> doing this when the path is only used a small number of times. Such a fix >> would be welcome, but is probably too large/risky to try to get into the >> current release cycle. It will have to wait for 1.3.1 >> >> Cheers, >> Mike >> >> >> >> On 07/30/2013 12:24 PM, Jeffrey Spencer wrote: >> >> K, I have just made the script self-contained but it loads external data >> so I have attached that as well. If you want me to just separate out the >> plotting commands let me know. I have also attached my matplotlib rc file >> which is the same on all three systems. All the modifications to the >> matplotlibrc file are copied to the top and in the first 30 lines or so. >> >> Of note, the smallest file sizes for pdf are using the pgf backend >> around 60kb. Not sure if that helps at all. It is also around the same size >> if I export to .eps and then convert to pdf. About 60kb. The problem with >> eps in these 3d figures though is the back wall I think has an alpha >> channel because just becomes a solid wall in the output. No lines through >> it like the other two walls. >> >> >> On Tue, Jul 30, 2013 at 11:23 PM, Jouni K. Seppänen <jk...@ik...> wrote: >> >>> Jeffrey Spencer <jef...@gm...> writes: >>> >>> > I have three different versions of matplotlib that all output different >>> > file sizes with matplotlib 1.1.1 providing the smallest. This is for >>> the >>> > same exact script. I can post the script if that helps. >>> > >>> > MPL 1.4.x: 539.32kb, Ubuntu 12.10 >>> > MPL 1.1.1: 172.56kb Ubuntu 12.10 >>> > MPL 1.2.1: 475.9kb, Ubuntu 13.04 >>> >>> Yes, it would be interesting to know what the plotting commands are. >>> Just as a guess, since all the sizes are a few hundred kilobytes, it >>> could be a difference in e.g. font embedding - many TrueType fonts are >>> of comparable size. >>> >>> -- >>> Jouni K. Seppänen >>> http://www.iki.fi/jks >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Get your SQL database under version control now! >>> Version control is standard for application code, but databases havent >>> caught up. So what steps can you take to put your SQL databases under >>> version control? Why should you start doing it? Read more to find out. >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >> >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but databases havent >> caught up. So what steps can you take to put your SQL databases under >> version control? Why should you start doing it? Read more to find out.http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> >> >> >> _______________________________________________ >> Matplotlib-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but databases havent >> caught up. So what steps can you take to put your SQL databases under >> version control? Why should you start doing it? Read more to find out. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > |
From: Michael D. <md...@st...> - 2013-07-31 13:32:04
|
On 07/30/2013 04:20 PM, Jeffrey Spencer wrote: > Michael, > > Thanks that is very informative. Answers most of the problems I was > having and read MEP14 which looks really useful > > That being said does the ps backend subset the fonts or use > collections for drawing (is the collections feature global or just in > the pdf backend)? The ps backend has the same behavior as pdf on both counts. TTF fonts are subsetted, but the fonts that come from TeX come to use as Type1 fonts, which matplotlib currently does not know how to subset. It also handles collections in the same way (by creating a "stamp" and reusing it). > I usually use .eps output and convert to pdf using epstopdf unless the > figure has an alpha channel because always results in a much smaller > file (60kB roughly for this file or plain figure around 10kB) than > direct pdf output with the output looking the same. I pretty much > always have usetex=True so maybe the pdf file is always embedding the > full fonts. Yes, when usetex=True, matplotlib does not do any font subsetting (in any backend). To get around this limitation, one can use the `pdftocairo` tool (part of poppler utils), to convert from pdf to a pdf with subsetted fonts. With your example, I was able to get the pdf down to ~80k. With MEP14, we would basically move such functionality into matplotlib itself, but that's sort of a long term, semi-back-burner project so it could be a while. It's possible that epstopdf is doing some font subsetting of its own. But as you point out, Postscript (as a specification) doesn't support alpha, so it's not useful when you need alpha. > > Also, does the Cairo backend support usetex=True or subsetting? I know > I had read it did not support usetex but that was maybe 2 years ago or > so. The x,y,z axis look correct with cairo but the IPA Fonts don't > render properly. The legend font says it is size 12 but if you zoom in > extremely close you can see they are the correct fonts just way to > small. The file size is around 60kB as well so I am guessing it > supports subsetting of fonts. Cairo does support font subsetting, but the matplotlib Cairo backend has no support for usetex. I'm surprised this worked for you at all. When I run your example with the Cairo backend, the IPA characters appear as raw TeX source code, i.e. "\textipa{i}", which is what I would expect given that the regular font renderer doesn't understand that syntax. > > The pgf backend would also subset fonts if output to .pdf I'm assuming > because that is the default with pdftex? It results in similar size > files to the .eps output for this file (roughly 60kB also). Yes. > > The IPA font uses the package (\usepackage{tipa}) and therefore that > is why I think these look differently. That package draws these fonts > with its' font libraries instead of whatever is selected as the text > font. Maybe I'm wrong about this but that is my understanding because > even in normal latex code the fonts look different than the standard text. That is correct. The default font for usetex=True is Computer Modern, whereas it is Bitstream Vera Sans in the default font rendering. I was referring to the difference between 1.2 and 1.4 which was using TeX fonts in both cases, but due to a bug in 1.3/1.4 was rendering the IPA in serif when you had requested sans-serif. Mike > > Cheers, > Jeff > > > On Wed, Jul 31, 2013 at 4:43 AM, Michael Droettboom <md...@st... > <mailto:md...@st...>> wrote: > > There are two different things going on here. > > Between 1.2.1 and now, there was a bugfix to the font selection > routine that inadvertently introduced a bug selecting fonts in the > usetex backend. You may notice that on master, the IPA font > selected is different. The file size difference can be attributed > to the slightly larger font size of the one it selected vs. the > one it should have. Note that when usetex is True, the fonts are > not subsetted, so you always get the full font embedded in the > file (MEP14 work will fix this in the future). > > See b5c340 for the bug that introduced the commit, and > https://github.com/matplotlib/matplotlib/pull/2260 for the fix > (which should make it into 1.3.0 final). > > Between 1.1.1 and 1.2.1 a change was made in how collections are > handled. Previously, each path was redrawn individually. In 1.2, > if a path is reused multiple times, a "stamp" is created and then > it is "used" multiple times. In principle, this generally reduces > file sizes by a large amount. However, in the case of this figure > with the 3D spheres, each path is used only once, so rather than > getting the file size savings of that approach, we only get the > overhead. The backend could be smarter by not doing this when the > path is only used a small number of times. Such a fix would be > welcome, but is probably too large/risky to try to get into the > current release cycle. It will have to wait for 1.3.1 > > Cheers, > Mike > > > > On 07/30/2013 12:24 PM, Jeffrey Spencer wrote: >> K, I have just made the script self-contained but it loads >> external data so I have attached that as well. If you want me to >> just separate out the plotting commands let me know. I have also >> attached my matplotlib rc file which is the same on all three >> systems. All the modifications to the matplotlibrc file are >> copied to the top and in the first 30 lines or so. >> >> Of note, the smallest file sizes for pdf are using the pgf >> backend around 60kb. Not sure if that helps at all. It is also >> around the same size if I export to .eps and then convert to pdf. >> About 60kb. The problem with eps in these 3d figures though is >> the back wall I think has an alpha channel because just becomes a >> solid wall in the output. No lines through it like the other two >> walls. >> >> >> On Tue, Jul 30, 2013 at 11:23 PM, Jouni K. Seppänen <jk...@ik... >> <mailto:jk...@ik...>> wrote: >> >> Jeffrey Spencer <jef...@gm... >> <mailto:jef...@gm...>> writes: >> >> > I have three different versions of matplotlib that all >> output different >> > file sizes with matplotlib 1.1.1 providing the smallest. >> This is for the >> > same exact script. I can post the script if that helps. >> > >> > MPL 1.4.x: 539.32kb, Ubuntu 12.10 >> > MPL 1.1.1: 172.56kb Ubuntu 12.10 >> > MPL 1.2.1: 475.9kb, Ubuntu 13.04 >> >> Yes, it would be interesting to know what the plotting >> commands are. >> Just as a guess, since all the sizes are a few hundred >> kilobytes, it >> could be a difference in e.g. font embedding - many TrueType >> fonts are >> of comparable size. >> >> -- >> Jouni K. Seppänen >> http://www.iki.fi/jks >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but >> databases havent >> caught up. So what steps can you take to put your SQL >> databases under >> version control? Why should you start doing it? Read more to >> find out. >> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> <mailto:Mat...@li...> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but databases havent >> caught up. So what steps can you take to put your SQL databases under >> version control? Why should you start doing it? Read more to find out. >> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... <mailto:Mat...@li...> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > <mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Jeffrey S. <jef...@gm...> - 2013-07-30 20:21:02
|
Michael, Thanks that is very informative. Answers most of the problems I was having and read MEP14 which looks really useful That being said does the ps backend subset the fonts or use collections for drawing (is the collections feature global or just in the pdf backend)? I usually use .eps output and convert to pdf using epstopdf unless the figure has an alpha channel because always results in a much smaller file (60kB roughly for this file or plain figure around 10kB) than direct pdf output with the output looking the same. I pretty much always have usetex=True so maybe the pdf file is always embedding the full fonts. Also, does the Cairo backend support usetex=True or subsetting? I know I had read it did not support usetex but that was maybe 2 years ago or so. The x,y,z axis look correct with cairo but the IPA Fonts don't render properly. The legend font says it is size 12 but if you zoom in extremely close you can see they are the correct fonts just way to small. The file size is around 60kB as well so I am guessing it supports subsetting of fonts. The pgf backend would also subset fonts if output to .pdf I'm assuming because that is the default with pdftex? It results in similar size files to the .eps output for this file (roughly 60kB also). The IPA font uses the package (\usepackage{tipa}) and therefore that is why I think these look differently. That package draws these fonts with its' font libraries instead of whatever is selected as the text font. Maybe I'm wrong about this but that is my understanding because even in normal latex code the fonts look different than the standard text. Cheers, Jeff On Wed, Jul 31, 2013 at 4:43 AM, Michael Droettboom <md...@st...> wrote: > There are two different things going on here. > > Between 1.2.1 and now, there was a bugfix to the font selection routine > that inadvertently introduced a bug selecting fonts in the usetex backend. > You may notice that on master, the IPA font selected is different. The > file size difference can be attributed to the slightly larger font size of > the one it selected vs. the one it should have. Note that when usetex is > True, the fonts are not subsetted, so you always get the full font embedded > in the file (MEP14 work will fix this in the future). > > See b5c340 for the bug that introduced the commit, and > https://github.com/matplotlib/matplotlib/pull/2260 for the fix (which > should make it into 1.3.0 final). > > Between 1.1.1 and 1.2.1 a change was made in how collections are handled. > Previously, each path was redrawn individually. In 1.2, if a path is > reused multiple times, a "stamp" is created and then it is "used" multiple > times. In principle, this generally reduces file sizes by a large amount. > However, in the case of this figure with the 3D spheres, each path is used > only once, so rather than getting the file size savings of that approach, > we only get the overhead. The backend could be smarter by not doing this > when the path is only used a small number of times. Such a fix would be > welcome, but is probably too large/risky to try to get into the current > release cycle. It will have to wait for 1.3.1 > > Cheers, > Mike > > > > On 07/30/2013 12:24 PM, Jeffrey Spencer wrote: > > K, I have just made the script self-contained but it loads external data > so I have attached that as well. If you want me to just separate out the > plotting commands let me know. I have also attached my matplotlib rc file > which is the same on all three systems. All the modifications to the > matplotlibrc file are copied to the top and in the first 30 lines or so. > > Of note, the smallest file sizes for pdf are using the pgf backend > around 60kb. Not sure if that helps at all. It is also around the same size > if I export to .eps and then convert to pdf. About 60kb. The problem with > eps in these 3d figures though is the back wall I think has an alpha > channel because just becomes a solid wall in the output. No lines through > it like the other two walls. > > > On Tue, Jul 30, 2013 at 11:23 PM, Jouni K. Seppänen <jk...@ik...> wrote: > >> Jeffrey Spencer <jef...@gm...> writes: >> >> > I have three different versions of matplotlib that all output different >> > file sizes with matplotlib 1.1.1 providing the smallest. This is for the >> > same exact script. I can post the script if that helps. >> > >> > MPL 1.4.x: 539.32kb, Ubuntu 12.10 >> > MPL 1.1.1: 172.56kb Ubuntu 12.10 >> > MPL 1.2.1: 475.9kb, Ubuntu 13.04 >> >> Yes, it would be interesting to know what the plotting commands are. >> Just as a guess, since all the sizes are a few hundred kilobytes, it >> could be a difference in e.g. font embedding - many TrueType fonts are >> of comparable size. >> >> -- >> Jouni K. Seppänen >> http://www.iki.fi/jks >> >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but databases havent >> caught up. So what steps can you take to put your SQL databases under >> version control? Why should you start doing it? Read more to find out. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out.http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Matplotlib-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Michael D. <md...@st...> - 2013-07-30 18:46:06
|
There are two different things going on here. Between 1.2.1 and now, there was a bugfix to the font selection routine that inadvertently introduced a bug selecting fonts in the usetex backend. You may notice that on master, the IPA font selected is different. The file size difference can be attributed to the slightly larger font size of the one it selected vs. the one it should have. Note that when usetex is True, the fonts are not subsetted, so you always get the full font embedded in the file (MEP14 work will fix this in the future). See b5c340 for the bug that introduced the commit, and https://github.com/matplotlib/matplotlib/pull/2260 for the fix (which should make it into 1.3.0 final). Between 1.1.1 and 1.2.1 a change was made in how collections are handled. Previously, each path was redrawn individually. In 1.2, if a path is reused multiple times, a "stamp" is created and then it is "used" multiple times. In principle, this generally reduces file sizes by a large amount. However, in the case of this figure with the 3D spheres, each path is used only once, so rather than getting the file size savings of that approach, we only get the overhead. The backend could be smarter by not doing this when the path is only used a small number of times. Such a fix would be welcome, but is probably too large/risky to try to get into the current release cycle. It will have to wait for 1.3.1 Cheers, Mike On 07/30/2013 12:24 PM, Jeffrey Spencer wrote: > K, I have just made the script self-contained but it loads external > data so I have attached that as well. If you want me to just separate > out the plotting commands let me know. I have also attached my > matplotlib rc file which is the same on all three systems. All the > modifications to the matplotlibrc file are copied to the top and in > the first 30 lines or so. > > Of note, the smallest file sizes for pdf are using the pgf backend > around 60kb. Not sure if that helps at all. It is also around the same > size if I export to .eps and then convert to pdf. About 60kb. The > problem with eps in these 3d figures though is the back wall I think > has an alpha channel because just becomes a solid wall in the output. > No lines through it like the other two walls. > > > On Tue, Jul 30, 2013 at 11:23 PM, Jouni K. Seppänen <jk...@ik... > <mailto:jk...@ik...>> wrote: > > Jeffrey Spencer <jef...@gm... > <mailto:jef...@gm...>> writes: > > > I have three different versions of matplotlib that all output > different > > file sizes with matplotlib 1.1.1 providing the smallest. This is > for the > > same exact script. I can post the script if that helps. > > > > MPL 1.4.x: 539.32kb, Ubuntu 12.10 > > MPL 1.1.1: 172.56kb Ubuntu 12.10 > > MPL 1.2.1: 475.9kb, Ubuntu 13.04 > > Yes, it would be interesting to know what the plotting commands are. > Just as a guess, since all the sizes are a few hundred kilobytes, it > could be a difference in e.g. font embedding - many TrueType fonts are > of comparable size. > > -- > Jouni K. Seppänen > http://www.iki.fi/jks > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > <mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Jeffrey S. <jef...@gm...> - 2013-07-30 18:12:38
|
My results for running that small code snippet is below so I actually get quite different results with the two different backends. Any idea what could be the cause? Creator: cairo 1.10.2 (http://cairographics.org) Producer: cairo 1.10.2 (http://cairographics.org) Tagged: no Pages: 1 Encrypted: no Page size: 245.081 x 151.466 pts File size: 4586 bytes Optimized: no PDF version: 1.5 Creator: matplotlib 1.3.0rc2, http://matplotlib.org Producer: matplotlib pdf backend CreationDate: Wed Jul 31 04:09:34 2013 Tagged: no Pages: 1 Encrypted: no Page size: 245.081 x 151.466 pts File size: 49126 bytes On Wed, Jul 31, 2013 at 3:43 AM, Eric Firing <ef...@ha...> wrote: > On 2013/07/29 9:17 PM, Jeffrey Spencer wrote: > > I have three different versions of matplotlib that all output different > > file sizes with matplotlib 1.1.1 providing the smallest. This is for the > > same exact script. I can post the script if that helps. > > > > MPL 1.4.x: 539.32kb, Ubuntu 12.10 > > MPL 1.1.1: 172.56kb Ubuntu 12.10 > > MPL 1.2.1: 475.9kb, Ubuntu 13.04 > > > > Is there a reason for this or why would such different file sizes be > > produced?? Also I tried using the matplotlib.use('cairo') with no > > difference. It actually says that the cairo backend is selected but the > > outputted pdf files show the matplotlib pdf backend was used. > > > > I can't reproduce this failure to produce a pdf file with cairo. With > mpl 1.4.x, > > import matplotlib > matplotlib.use('cairo') > import matplotlib.pyplot as plt > plt.plot([1,2,3]) > plt.savefig("test.pdf") > > The result is > > efiring@manini3:~$ pdfinfo test.pdf > Creator: cairo 1.10.2 (http://cairographics.org) > Producer: cairo 1.10.2 (http://cairographics.org) > Tagged: no > Pages: 1 > Encrypted: no > Page size: 576 x 432 pts > File size: 5261 bytes > Optimized: no > PDF version: 1.5 > > Repeating but without specifying the cairo backend I get: > > efiring@manini3:~$ pdfinfo test_default.pdf > Creator: matplotlib 1.4.x, http://matplotlib.org > Producer: matplotlib pdf backend > CreationDate: Mon Jul 29 21:51:22 2013 > Tagged: no > Pages: 1 > Encrypted: no > Page size: 576 x 432 pts > File size: 5184 bytes > Optimized: no > PDF version: 1.4 > > Eric > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Jeffrey S. <jef...@gm...> - 2013-07-30 18:06:18
|
Sorry about the Cairo backend. That was a mistake on my end in the command getting overridden by loading my matplotlibrc file that I overlooked. It was the first time I was using the new rc load features. So I actually got that working but the latex code \textipa{} didn't display correctly with the cairo backend. The characters were missing from the output pdf file but it appeared it would be a smaller file size than the matplotlib backend but could have had to do with the font embedding. Cheers On Wed, Jul 31, 2013 at 3:43 AM, Eric Firing <ef...@ha...> wrote: > On 2013/07/29 9:17 PM, Jeffrey Spencer wrote: > > I have three different versions of matplotlib that all output different > > file sizes with matplotlib 1.1.1 providing the smallest. This is for the > > same exact script. I can post the script if that helps. > > > > MPL 1.4.x: 539.32kb, Ubuntu 12.10 > > MPL 1.1.1: 172.56kb Ubuntu 12.10 > > MPL 1.2.1: 475.9kb, Ubuntu 13.04 > > > > Is there a reason for this or why would such different file sizes be > > produced?? Also I tried using the matplotlib.use('cairo') with no > > difference. It actually says that the cairo backend is selected but the > > outputted pdf files show the matplotlib pdf backend was used. > > > > I can't reproduce this failure to produce a pdf file with cairo. With > mpl 1.4.x, > > import matplotlib > matplotlib.use('cairo') > import matplotlib.pyplot as plt > plt.plot([1,2,3]) > plt.savefig("test.pdf") > > The result is > > efiring@manini3:~$ pdfinfo test.pdf > Creator: cairo 1.10.2 (http://cairographics.org) > Producer: cairo 1.10.2 (http://cairographics.org) > Tagged: no > Pages: 1 > Encrypted: no > Page size: 576 x 432 pts > File size: 5261 bytes > Optimized: no > PDF version: 1.5 > > Repeating but without specifying the cairo backend I get: > > efiring@manini3:~$ pdfinfo test_default.pdf > Creator: matplotlib 1.4.x, http://matplotlib.org > Producer: matplotlib pdf backend > CreationDate: Mon Jul 29 21:51:22 2013 > Tagged: no > Pages: 1 > Encrypted: no > Page size: 576 x 432 pts > File size: 5184 bytes > Optimized: no > PDF version: 1.4 > > Eric > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Eric F. <ef...@ha...> - 2013-07-30 17:43:19
|
On 2013/07/29 9:17 PM, Jeffrey Spencer wrote: > I have three different versions of matplotlib that all output different > file sizes with matplotlib 1.1.1 providing the smallest. This is for the > same exact script. I can post the script if that helps. > > MPL 1.4.x: 539.32kb, Ubuntu 12.10 > MPL 1.1.1: 172.56kb Ubuntu 12.10 > MPL 1.2.1: 475.9kb, Ubuntu 13.04 > > Is there a reason for this or why would such different file sizes be > produced?? Also I tried using the matplotlib.use('cairo') with no > difference. It actually says that the cairo backend is selected but the > outputted pdf files show the matplotlib pdf backend was used. > I can't reproduce this failure to produce a pdf file with cairo. With mpl 1.4.x, import matplotlib matplotlib.use('cairo') import matplotlib.pyplot as plt plt.plot([1,2,3]) plt.savefig("test.pdf") The result is efiring@manini3:~$ pdfinfo test.pdf Creator: cairo 1.10.2 (http://cairographics.org) Producer: cairo 1.10.2 (http://cairographics.org) Tagged: no Pages: 1 Encrypted: no Page size: 576 x 432 pts File size: 5261 bytes Optimized: no PDF version: 1.5 Repeating but without specifying the cairo backend I get: efiring@manini3:~$ pdfinfo test_default.pdf Creator: matplotlib 1.4.x, http://matplotlib.org Producer: matplotlib pdf backend CreationDate: Mon Jul 29 21:51:22 2013 Tagged: no Pages: 1 Encrypted: no Page size: 576 x 432 pts File size: 5184 bytes Optimized: no PDF version: 1.4 Eric |
From: Jeffrey S. <jef...@gm...> - 2013-07-30 16:25:02
|
K, I have just made the script self-contained but it loads external data so I have attached that as well. If you want me to just separate out the plotting commands let me know. I have also attached my matplotlib rc file which is the same on all three systems. All the modifications to the matplotlibrc file are copied to the top and in the first 30 lines or so. Of note, the smallest file sizes for pdf are using the pgf backend around 60kb. Not sure if that helps at all. It is also around the same size if I export to .eps and then convert to pdf. About 60kb. The problem with eps in these 3d figures though is the back wall I think has an alpha channel because just becomes a solid wall in the output. No lines through it like the other two walls. On Tue, Jul 30, 2013 at 11:23 PM, Jouni K. Seppänen <jk...@ik...> wrote: > Jeffrey Spencer <jef...@gm...> writes: > > > I have three different versions of matplotlib that all output different > > file sizes with matplotlib 1.1.1 providing the smallest. This is for the > > same exact script. I can post the script if that helps. > > > > MPL 1.4.x: 539.32kb, Ubuntu 12.10 > > MPL 1.1.1: 172.56kb Ubuntu 12.10 > > MPL 1.2.1: 475.9kb, Ubuntu 13.04 > > Yes, it would be interesting to know what the plotting commands are. > Just as a guess, since all the sizes are a few hundred kilobytes, it > could be a difference in e.g. font embedding - many TrueType fonts are > of comparable size. > > -- > Jouni K. Seppänen > http://www.iki.fi/jks > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Michael D. <md...@st...> - 2013-07-30 15:55:47
|
On 07/30/2013 09:23 AM, Jouni K. Seppänen wrote: > Jeffrey Spencer <jef...@gm...> writes: > >> I have three different versions of matplotlib that all output different >> file sizes with matplotlib 1.1.1 providing the smallest. This is for the >> same exact script. I can post the script if that helps. >> >> MPL 1.4.x: 539.32kb, Ubuntu 12.10 >> MPL 1.1.1: 172.56kb Ubuntu 12.10 >> MPL 1.2.1: 475.9kb, Ubuntu 13.04 > Yes, it would be interesting to know what the plotting commands are. > Just as a guess, since all the sizes are a few hundred kilobytes, it > could be a difference in e.g. font embedding - many TrueType fonts are > of comparable size. > In addition to your plot script, any matplotlibrc customizations that you may have in effect would be helpful. Mike |
From: Jouni K. S. <jk...@ik...> - 2013-07-30 13:24:15
|
Jeffrey Spencer <jef...@gm...> writes: > I have three different versions of matplotlib that all output different > file sizes with matplotlib 1.1.1 providing the smallest. This is for the > same exact script. I can post the script if that helps. > > MPL 1.4.x: 539.32kb, Ubuntu 12.10 > MPL 1.1.1: 172.56kb Ubuntu 12.10 > MPL 1.2.1: 475.9kb, Ubuntu 13.04 Yes, it would be interesting to know what the plotting commands are. Just as a guess, since all the sizes are a few hundred kilobytes, it could be a difference in e.g. font embedding - many TrueType fonts are of comparable size. -- Jouni K. Seppänen http://www.iki.fi/jks |
From: Jeffrey S. <jef...@gm...> - 2013-07-30 08:00:01
|
I have old scripts I had made that I was rerunning in newer versions of matplotlib. They now fail because the function requires dashes to be greater than 0. I have them set to zero as below and it still throws the error. I had to set the zero in the middle to 1e-12 to get around this but is this the desired behavior? I don't see why 0 can't be an acceptable input to the dash function. This is on matplotlib 1.3.0rc2. Example code: dashes = [(1.5,1.5,3,1.5),(1,0),(1,1.2)] legendLabels.append(ax.plot(x,y[i], color=plotColor[i%8], dashes=dashes[i%3])[0]) End of error: /home/bigtyme/.virtualenvs/ipl/local/lib/python2.7/site-packages/matplotlib-1.3.0rc2-py2.7-linux-x86_64.egg/matplotlib/lines.pyc in _draw_lines(self, renderer, gc, path, trans) 936 937 def _draw_lines(self, renderer, gc, path, trans): --> 938 self._lineFunc(renderer, gc, path, trans) 939 940 def _draw_steps_pre(self, renderer, gc, path, trans): /home/bigtyme/.virtualenvs/ipl/local/lib/python2.7/site-packages/matplotlib-1.3.0rc2-py2.7-linux-x86_64.egg/matplotlib/lines.pyc in _draw_dashed(self, renderer, gc, path, trans) 981 gc.set_linestyle('dashed') 982 if self._dashSeq is not None: --> 983 gc.set_dashes(0, self._dashSeq) 984 985 renderer.draw_path(gc, path, trans) /home/bigtyme/.virtualenvs/ipl/local/lib/python2.7/site-packages/matplotlib-1.3.0rc2-py2.7-linux-x86_64.egg/matplotlib/backend_bases.pyc in set_dashes(self, dash_offset, dash_list) 902 dl = np.asarray(dash_list) 903 if np.any(dl <= 0.0): --> 904 raise ValueError("All values in the dash list must be positive") 905 self._dashes = dash_offset, dash_list 906 ValueError: All values in the dash list must be positive Cheers, Jeff |
From: Jeffrey S. <jef...@gm...> - 2013-07-30 07:18:18
|
I have three different versions of matplotlib that all output different file sizes with matplotlib 1.1.1 providing the smallest. This is for the same exact script. I can post the script if that helps. MPL 1.4.x: 539.32kb, Ubuntu 12.10 MPL 1.1.1: 172.56kb Ubuntu 12.10 MPL 1.2.1: 475.9kb, Ubuntu 13.04 Is there a reason for this or why would such different file sizes be produced?? Also I tried using the matplotlib.use('cairo') with no difference. It actually says that the cairo backend is selected but the outputted pdf files show the matplotlib pdf backend was used. |
From: K.-Michael A. <kmi...@gm...> - 2013-07-30 01:43:50
|
I have creted two polar stereographic basemaps that look like this: http://imgur.com/ayqINQ6 But when zooming in, this happens: http://imgur.com/ca5OFgj I have confirmed that this happens only for the Basemap with round=True option. Michael |
From: K.-Michael A. <kmi...@gm...> - 2013-07-30 00:14:06
|
Hi! Is there a way to copy an axes object into different figures? The idea would be to first create a valuable plot, save it on its own into a file, and then add it to a subplots figure as part of an overview? I tried to play with this but can't make it to show up in an pylab session: plot(arange(10)) ax = gca() fig, axes = subplots(2,2) axes[0,0].set_axes(ax) If the above is correct, how can I make it show up now? fig.show() did not work and fig.draw() needs an artist and a renderer which I am unsure where to get them from? Any hints, or which docs to read as usual apprectiated! Michael |
From: Sterling S. <sm...@fu...> - 2013-07-29 16:48:30
|
Chao, From your description, it is clear that you are using a very customized application of axes placement and design. The only method that I see for replacing your current setup with Subplots (I use the upper case to denote the instances of the class, which do respond to the left/right/wspace parameters) is the following (untested): {{{ fig,axs = plt.subplots(2,3) for i,ax in enumerate(axs.flat): ax.plot(time,data) ymin,ymax = ax.get_ylim() ax.set_ylim(ymin=ymin,ymax=ymin+2*(ymax-ymin)) labels = ax.get_yticklabels() for l in labels: if float(l.get_text()) > ymax: l.set_visible(False) ax2 = ax.twinx() ymin,ymax = ax2.get_ylim() ax2.set_ylim(ymin=ymax-2*(ymax-ymin),ymax=ymax) labels = ax2.get_yticklabels() for l in labels: if float(l.get_text()) < ymin: l.set_visible(False) }}} Some of this is inspired by http://matplotlib.org/examples/api/two_scales.html and similar examples/applications. Hope that helps, Sterling On Jul 27, 2013, at 6:10AM, ChaoYue wrote: > Hi, thanks. > > the attached is what I achieved so far. Looks quite nice. > > each subplot visible now actually contains two mat.axes.Axes object (with bottom and top spines invisible) > which is created by using the fig.add_axes, before the place occupied by the two axes now is actually > only one single subplot ojbect, which is created by using fig,axs = plt.subplots(2,3). something like this: > > for ax in axs.flatten(): > #some way to find the position of the two new axes > sub1 = fig.add_axes(....) > sub2 = fig.add_axes(....) > fig.delaxes(ax) > > Now the problem is that all the original subplots have been removed, replaced by 2X6 mat.axes.Axes, > But they don't respond to any operation in the interacitve window (like, you can use your mouse to select > the left/righ/wspace etc....) > > I hope I am clear. thanks! > > cheers, > > Chao > > On Fri, Jul 26, 2013 at 5:55 PM, Sterling Smith [via matplotlib] <[hidden email]> wrote: > Chao, > > You are right, fig.add_subplot does not support precise positioning. Why don't you send a picture of a sample layout you have obtained with add_axes? > > -Sterling > > On Jul 26, 2013, at 1:26AM, ChaoYue wrote: > > > Dear Sterling, > > > > thanks for your answer. The idea is that I would like to add a subplot with precise position, as in the method of fig.add_axes? > > Does fig.add_subplot support this, I tried fig.add_subplot(position=(0.2,0.2,0.1,0.1)) but it does not work... > > > > thanks! > > > > Chao > > > > On Thu, Jul 25, 2013 at 8:09 PM, Sterling Smith [via matplotlib] <[hidden email]> wrote: > > > Chao, > > > > plt.subplots returns a figure instance. Can you use the add_subplot method of that figure instance to make your new axes? If so, then I think that they should respond to the new requests for left/right/bottom/wspace space. > > > > -Sterling > > > > On Jul 25, 2013, at 10:06AM, Chao YUE wrote: > > > > > Dear all, > > > > > > First I make some subplots using the plt.subplots command, > > > then I use mat.figure.Figure.delaxes to delete the axes, and add some small new ones > > > in the same space by using mat.figure.Figure.add_axes, but I find after rendering the > > > figure in the interative window, I cannot adjust the left/right/bottom/wspace etc in a > > > interactive way, the old subplots that are generated using plt.subplots command will > > > move, and the new ones generated using mat.figure.Figure.add_axes just don't > > > move at all, so what should I do if I want the new ones also move? Because > > > the interative window is really useful when you want to have figures quickly. > > > > > > thanks a lot for any hints. > > > > > > cheers, > > > > > > Chao > > > > > > -- > > > *********************************************************************************** > > > Chao YUE > > > Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) > > > UMR 1572 CEA-CNRS-UVSQ > > > Batiment 712 - Pe 119 > > > 91191 GIF Sur YVETTE Cedex > > > Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 > > > ************************************************************************************ > > > ------------------------------------------------------------------------------ > > > See everything from the browser to the database with AppDynamics > > > Get end-to-end visibility with application monitoring from AppDynamics > > > Isolate bottlenecks and diagnose root cause in seconds. > > > Start your free trial of AppDynamics Pro today! > > > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk_______________________________________________ > > > Matplotlib-users mailing list > > > > [hidden email] > > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > ------------------------------------------------------------------------------ > > See everything from the browser to the database with AppDynamics > > Get end-to-end visibility with application monitoring from AppDynamics > > Isolate bottlenecks and diagnose root cause in seconds. > > Start your free trial of AppDynamics Pro today! > > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > > _______________________________________________ > > Matplotlib-users mailing list > > [hidden email] > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > If you reply to this email, your message will be added to the discussion below: > > http://matplotlib.1069221.n5.nabble.com/how-to-make-mat-figure-Figure-add-axes-generated-axes-adjustable-with-the-interactive-tool-tp41610p41611.html > > To start a new topic under matplotlib - users, email [hidden email] > > To unsubscribe from matplotlib, click here. > > > NAML > > > > > > > > -- > > *********************************************************************************** > > Chao YUE > > Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) > > UMR 1572 CEA-CNRS-UVSQ > > Batiment 712 - Pe 119 > > 91191 GIF Sur YVETTE Cedex > > Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 > > ************************************************************************************ > > > > View this message in context: Re: how to make mat.figure.Figure.add_axes generated axes adjustable with the interactive tool? > > Sent from the matplotlib - users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > > See everything from the browser to the database with AppDynamics > > Get end-to-end visibility with application monitoring from AppDynamics > > Isolate bottlenecks and diagnose root cause in seconds. > > Start your free trial of AppDynamics Pro today! > > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk_______________________________________________ > > Matplotlib-users mailing list > > [hidden email] > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > If you reply to this email, your message will be added to the discussion below: > http://matplotlib.1069221.n5.nabble.com/how-to-make-mat-figure-Figure-add-axes-generated-axes-adjustable-with-the-interactive-tool-tp41610p41615.html > To start a new topic under matplotlib - users, email [hidden email] > To unsubscribe from matplotlib, click here. > NAML > > > > -- > *********************************************************************************** > Chao YUE > Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) > UMR 1572 CEA-CNRS-UVSQ > Batiment 712 - Pe 119 > 91191 GIF Sur YVETTE Cedex > Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 > ************************************************************************************ > > eg1.jpg (319K) Download Attachment > > View this message in context: Re: how to make mat.figure.Figure.add_axes generated axes adjustable with the interactive tool? > Sent from the matplotlib - users mailing list archive at Nabble.com. > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk_______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Frédéric P. <par...@gm...> - 2013-07-29 14:34:14
|
Currently, one call figures with their number in matplotlib. If you have a code which draw a lot a different figures at different places with some of them being optional, this is not very convenient. One convenient way to call figure would be to use a dictionnary of figures. Of course I could create some wrapper around matplotlib.figure function but it would be far more convenient if such feature would be standard in matplotlib. Is there any plan to implement such a feature? Best regards, Frédéric Parrenin |
From: Magician <f_m...@ma...> - 2013-07-27 16:47:28
|
Hi all, I'm trying to animate scatter plots on Matplotlib 1.2.1. My code is as below: > import numpy as np > import matplotlib as mpl > import matplotlib.pyplot as plt > import matplotlib.animation as anm > > x = np.array([np.cos(i) for i in np.arange(0.0, 360.0, 9.0) / 180.0 * np.pi]) > y = np.array([np.sin(i) for i in np.arange(0.0, 360.0, 9.0) / 180.0 * np.pi]) > z = np.arange(0.0, 1.0, 0.025) > > cdict = { > 'red': ( > (0.0, 0.0, 0.0), > (0.5, 0.5, 0.5), > (1.0, 1.0, 1.0) > ), > 'green': ( > (0.0, 0.0, 0.0), > (0.5, 0.0, 0.0), > (1.0, 0.0, 0.0) > ), > 'blue': ( > (0.0, 0.0, 0.0), > (0.5, 0.0, 0.0), > (1.0, 0.0, 0.0) > ) > } > my_cmap = mpl.colors.LinearSegmentedColormap('my_colormap', cdict, 256) > > fig = plt.figure() > ax = fig.add_subplot(111) > > def init(): > sct.set_offsets(([], [])) > > def update_sct(i, sct): > sct.set_offsets((x[i], y[i])) > return sct > > sct = ax.scatter([], [], marker = 'o', s = 10.0, linewidth = 1.0, cmap = my_cmap, c = []) > sct_anm = anm.FuncAnimation(fig, update_sct, fargs = (sct,), interval = 100, frames = len(x)) > ax.set_xlim((-2.0, 2.0)) > ax.set_ylim((-2.0, 2.0)) > plt.show() Now I'm trying to set scatters' colors mapped by 'z'. How can I set scatters' c values in each frame? Magician |
From: ChaoYue <cha...@gm...> - 2013-07-27 13:10:17
|
Hi, thanks. the attached is what I achieved so far. Looks quite nice. each subplot visible now actually contains two mat.axes.Axes object (with bottom and top spines invisible) which is created by using the fig.add_axes, before the place occupied by the two axes now is actually only one single subplot ojbect, which is created by using fig,axs = plt.subplots(2,3). something like this: for ax in axs.flatten(): #some way to find the position of the two new axes sub1 = fig.add_axes(....) sub2 = fig.add_axes(....) fig.delaxes(ax) Now the problem is that all the original subplots have been removed, replaced by 2X6 mat.axes.Axes, But they don't respond to any operation in the interacitve window (like, you can use your mouse to select the left/righ/wspace etc....) I hope I am clear. thanks! cheers, Chao On Fri, Jul 26, 2013 at 5:55 PM, Sterling Smith [via matplotlib] < ml-...@n5...> wrote: > Chao, > > You are right, fig.add_subplot does not support precise positioning. Why > don't you send a picture of a sample layout you have obtained with > add_axes? > > -Sterling > > On Jul 26, 2013, at 1:26AM, ChaoYue wrote: > > > Dear Sterling, > > > > thanks for your answer. The idea is that I would like to add a subplot > with precise position, as in the method of fig.add_axes? > > Does fig.add_subplot support this, I tried > fig.add_subplot(position=(0.2,0.2,0.1,0.1)) but it does not work... > > > > thanks! > > > > Chao > > > > On Thu, Jul 25, 2013 at 8:09 PM, Sterling Smith [via matplotlib] > <[hidden email]> wrote: > > Chao, > > > > plt.subplots returns a figure instance. Can you use the add_subplot > method of that figure instance to make your new axes? If so, then I think > that they should respond to the new requests for left/right/bottom/wspace > space. > > > > -Sterling > > > > On Jul 25, 2013, at 10:06AM, Chao YUE wrote: > > > > > Dear all, > > > > > > First I make some subplots using the plt.subplots command, > > > then I use mat.figure.Figure.delaxes to delete the axes, and add some > small new ones > > > in the same space by using mat.figure.Figure.add_axes, but I find > after rendering the > > > figure in the interative window, I cannot adjust the > left/right/bottom/wspace etc in a > > > interactive way, the old subplots that are generated using > plt.subplots command will > > > move, and the new ones generated using mat.figure.Figure.add_axes just > don't > > > move at all, so what should I do if I want the new ones also move? > Because > > > the interative window is really useful when you want to have figures > quickly. > > > > > > thanks a lot for any hints. > > > > > > cheers, > > > > > > Chao > > > > > > -- > > > > *********************************************************************************** > > > > Chao YUE > > > Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) > > > UMR 1572 CEA-CNRS-UVSQ > > > Batiment 712 - Pe 119 > > > 91191 GIF Sur YVETTE Cedex > > > Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 > > > > ************************************************************************************ > > > > > ------------------------------------------------------------------------------ > > > > See everything from the browser to the database with AppDynamics > > > Get end-to-end visibility with application monitoring from AppDynamics > > > Isolate bottlenecks and diagnose root cause in seconds. > > > Start your free trial of AppDynamics Pro today! > > > > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk_______________________________________________ > > > Matplotlib-users mailing list > > > [hidden email] > > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > > ------------------------------------------------------------------------------ > > > See everything from the browser to the database with AppDynamics > > Get end-to-end visibility with application monitoring from AppDynamics > > Isolate bottlenecks and diagnose root cause in seconds. > > Start your free trial of AppDynamics Pro today! > > > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > > _______________________________________________ > > Matplotlib-users mailing list > > [hidden email] > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > If you reply to this email, your message will be added to the discussion > below: > > > http://matplotlib.1069221.n5.nabble.com/how-to-make-mat-figure-Figure-add-axes-generated-axes-adjustable-with-the-interactive-tool-tp41610p41611.html > > To start a new topic under matplotlib - users, email [hidden email] > > To unsubscribe from matplotlib, click here. > > NAML > > > > > > > > -- > > > *********************************************************************************** > > > Chao YUE > > Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) > > UMR 1572 CEA-CNRS-UVSQ > > Batiment 712 - Pe 119 > > 91191 GIF Sur YVETTE Cedex > > Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 > > > ************************************************************************************ > > > > > View this message in context: Re: how to make mat.figure.Figure.add_axes > generated axes adjustable with the interactive tool? > > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > > > See everything from the browser to the database with AppDynamics > > Get end-to-end visibility with application monitoring from AppDynamics > > Isolate bottlenecks and diagnose root cause in seconds. > > Start your free trial of AppDynamics Pro today! > > > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk_______________________________________________ > > Matplotlib-users mailing list > > [hidden email] <http://user/SendEmail.jtp?type=node&node=41615&i=0> > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------------ > > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > [hidden email] <http://user/SendEmail.jtp?type=node&node=41615&i=1> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://matplotlib.1069221.n5.nabble.com/how-to-make-mat-figure-Figure-add-axes-generated-axes-adjustable-with-the-interactive-tool-tp41610p41615.html > To start a new topic under matplotlib - users, email > ml-...@n5... > To unsubscribe from matplotlib, click here<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx> > . > NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************ eg1.jpg (319K) <http://matplotlib.1069221.n5.nabble.com/attachment/41617/0/eg1.jpg> -- View this message in context: http://matplotlib.1069221.n5.nabble.com/how-to-make-mat-figure-Figure-add-axes-generated-axes-adjustable-with-the-interactive-tool-tp41610p41617.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Jeffrey S. <jef...@gm...> - 2013-07-26 20:41:27
|
I have version 1.2.x of matplotlib. The minimal example shows the case below. The back wall will lose its lines. Is there a reason for this? Is there a transparent layer there so eps has to put it as a solid wall? If so, is there a way to remove that transparent layer? Pdf and the other backends have no problem exporting correctly. import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D fig = plt.figure() ax = fig.add_subplot(111, projection='3d') plt.savefig('testing.eps') |