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
(4) |
3
|
4
(5) |
5
|
6
(9) |
7
(1) |
8
(1) |
9
(1) |
10
|
11
(2) |
12
(6) |
13
(5) |
14
(3) |
15
(1) |
16
(1) |
17
(2) |
18
(7) |
19
(1) |
20
(4) |
21
(8) |
22
(3) |
23
(3) |
24
|
25
(1) |
26
(3) |
27
(5) |
28
(3) |
29
|
30
|
From: David K. <da...@da...> - 2013-11-21 00:28:53
|
Hello ! I would like to have some hints about the matplotlib usage, especially the PGF/tikz backend. I use a latex document, and almost only tikz figures. I have a couple of problems with the matplotlib package. The first is the preemptive behaviour of the matplotlib package over the used fonts. I would like the text to be let "as it", without adding stuff like \sffamily\ttffont, and so on. For example, if I write "$L^2$" as a legend axis, I want this text to be let "as it", without any modification by the pgf backend. A second point, is that I would like to not use the \begin{pgffigure}\end{pgffigure}, the \makeatletter and fancy stuff like that. I want to take care myself of the latex code. Is it possible ? Finally, Would it be possible to specify the size of the graphic somewhere ? The documentation is rather vague about it. Thank you for help. |
From: Juergen H. <py...@el...> - 2013-11-20 18:23:28
|
Have you tried latex_float() as suggested here ? http://stackoverflow.com/questions/13490292/format-number-using-latex-notation-in-python def latex_float(f): float_str = "{0:.2g}".format(f) if "e" in float_str: base, exponent = float_str.split("e") return r"{0} \times 10^{{{1}}}".format(base, int(exponent)) else: return float_str title (r'$\omega=%s$' % latex_float(omega)) Am 20.11.2013 19:00, schrieb Neal Becker: > I tried: > > plt.title (r'$\omega=%s$' % omega), where omega=-1e-5. The title says: > > omega=-1e-05 > > with the 'e' in italics, and the whole thing generally ugly. > > What I'd like to see is what TeX would do for $1 \times 10^{5}$. > > I know mpl already can nicely format numbers for axis. Can I somehow use that > mechanism to nicely format numbers in my title (or other places)? > > > ------------------------------------------------------------------------------ > Shape the Mobile Experience: Free Subscription > Software experts and developers: Be at the forefront of tech innovation. > Intel(R) Software Adrenaline delivers strategic insight and game-changing > conversations that shape the rapidly evolving mobile landscape. Sign up now. > http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Neal B. <ndb...@gm...> - 2013-11-20 18:00:32
|
I tried: plt.title (r'$\omega=%s$' % omega), where omega=-1e-5. The title says: omega=-1e-05 with the 'e' in italics, and the whole thing generally ugly. What I'd like to see is what TeX would do for $1 \times 10^{5}$. I know mpl already can nicely format numbers for axis. Can I somehow use that mechanism to nicely format numbers in my title (or other places)? |
From: Riccardo R. <ric...@gm...> - 2013-11-20 16:04:18
|
Hi all, I'm running CentOS 5.9 and I would like to install the latest version of matplotlib (or at least 1.2). The version of python I would like to use is 2.6 and it's invokable only with `python26`, not just `python`. Now, I downloaded the tarball and installed the required packages separately from their respective tarball, but I can't build (let alone install) matplotlib: In short, it says: */usr/share/python2.6/CXX/cxxsupport.cxx:40:38: error: Src/Python2/cxxsupport.cxx: No such file or directory* The full output is here: http://pastebin.com/7mVKZ6P5 I installed pycxx manually and it appears as *pycxx: yes [Using system CXX (version unknown, no pkg-config info)]* Any idea on how I can fix this? Thanks! Riccardo |
From: Chad K. <cck...@gm...> - 2013-11-20 02:37:02
|
On 11/18/2013 12:29 PM, Coleman, Bradley wrote: > > Chad, yes that's the problem. Thanks for responding. > > > > "If you like the way the image appears on screen, use the DPI argument > to savefig()" > > > > I don't exactly understand this. What do you mean on screen? This > code is integrated with a big project that I'm running inside of > ecplise, so I'm not sure what you mean by on screen? Either way, when > I add and change a DPI argument to savefig(), it just blows up the > dimensions of the PNG. > If you display the figure using show(), and you like how it looks, you can ramp up the dpi for the saved figure by giving savefig() the dpi=xx argument. > > > "My question back to you is, why does it matter? Most layout programs > will let you set the physical size of the figure and scale the DPI to > match." > > * * > > So you're saying, fine let it produce a huge png and then shrink it > with the html img tag and that will do the job, right? Well, that's > really hard for us to do because we're using an existing solution and > changing that will involve lawyers, I kid you not. > > > And I thought my change review boards were rough... > So, I can increase the DPI on the savefig call and correspondingly > shrink the dimensions of the file in inches to get it to stay the same > size, but the problem is the text and the lines, and the axis tick > marks don't shrink too, which is really frustrating. I can then > shrink the fonts, but I don't know how to shrink the tick marks and > the lines. Anyways, it really seems like there should be an easier > way -- not to appear unappreciative in any way of the hard work the > devs put into this excellent project! > > > It sounds like you may need to increase the image size in inches and decrease the dpi to do what you want. It sounds like your html framework or web browser is not respecting the dpi setting in the png file that is created. As others have mentioned, can you generate an SVG and embed that instead? > Thanks! > > Bradley > > > > > > _ > > > > > > *From:*Chad Kidder [mailto:cck...@gm...] > *Sent:* Saturday, November 16, 2013 11:34 PM > *To:* Coleman, Bradley > *Subject:* Re: [Matplotlib-users] how can i raise the dpi without > changing the dimensions of my picture? > > > > Let me see if I understand this right, you want to leave the image > dimensions, in inches, constant while increasing the resolution in DPI > to get a sharper image. Did I get that correct? > > If you like the way the image appears on screen, use the DPI argument > to savefig(). My experience is that if you change the DPI when > creating the figure, that will change the layout. > > What it sounds like you are seeing is that when you crank the DPI up, > the PNG you created does not change its listed DPI, and displays > larger. I checked on my system, matplotlib 1.1.1, and it is updating > the DPI in the PNG files. > > My question back to you is, why does it matter? Most layout programs > will let you set the physical size of the figure and scale the DPI to > match. > > On Nov 16, 2013 3:06 PM, "Bradley Coleman" <col...@se... > <mailto:col...@se...>> wrote: > > Hi there, I make a figure, then I do some stuff, then I save the figure. > > stuff > fig = figure(figsize = (0.75, 3.5)) > stuff > fig.savefig('name.png', bbox_inches='tight') > > My figure is perfect, but I'm having trouble increasing the resolution. > There are two ways that I can figure out to do that, one is send a dpi > as an > argument to figure() and the other to savefig(). Sending it to figure() > doesn't change the file at all, so I'm not sure what it does, but > sending it > to savefig() does change the file. When I send dpi to savefig(), like > dpi=500, the resolution seems to get much better, and the file size grows, > but the problem is that the height and width of the picture grows too. I > want the resolution to go up, but not the height and width of the picture. > What can I do? > > Thanks! > Bradley > > > > ------------------------------------------------------------------------------ > DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps > OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access > Free app hosting. Or install the open source package on any LAMP server. > Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! > http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > <mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Joe K. <jof...@gm...> - 2013-11-19 19:47:36
|
Until very recently<http://stackoverflow.com/questions/20069545/2d-plotting-with-colors-like-spectrograms-magnitude-plots#comment29914445_20069545>, I had somehow wound up with the impression that `pcolormesh` only handles rectilinear coordinate arrays, while `pcolor` can handle arbitrarily shaped quadrilaterals. Apparently, both pcolor and pcolormesh can handle any type of quadrilateral. For example: import numpy as np import matplotlib.pyplot as plt y, x = np.mgrid[:10, :10].astype(float) x += 0.5 * np.random.random(x.shape) y += 0.5 * np.random.random(y.shape) z = np.random.random(x.shape) fig, axes = plt.subplots(ncols=2) axes[0].pcolor(x, y, z) axes[1].pcolormesh(x, y, z) plt.show() Given that, is there any effective difference between `pcolor` and `pcolormesh` other than that `pcolor` creates a `PolyCollection` and `pcolormesh` creates a `QuadMesh`? In other words, is there anything that `pcolor` can display that `pcolormesh` can't? Thanks! -Joe |
From: Cristóbal G. <kir...@gm...> - 2013-11-18 23:40:05
|
> Can you import and run numpy on the system in question? No, I cant: >>> import numpy GotoBLAS : Architecture Initialization failed. No initialization function found. Thanks for the suggestion! |
From: Eric F. <ef...@ha...> - 2013-11-18 23:33:08
|
On 2013/11/18 1:09 PM, Cristóbal Ganter wrote: > Hi I'm trying to install matplotlib in debian wheezy. But I get the > following error: > GotoBLAS : Architecture Initialization failed. No initialization function found. > I can't find anything useful in google. Matplotlib doesn't know about blas directly, as far as I know, so my guess is that the error is actually coming from an attempt to import numpy. Can you import and run numpy on the system in question? Based on your link below, I suspect it is indeed a KVM problem; the error message suggests that GotoBLAS is trying to configure itself based on the architecture it is running on. Maybe the KVM VM is not identifying itself in a way that GotoBLAS recognizes. Eric > > You can find more details of my question in: > http://stackoverflow.com/questions/20058653/gotoblas-error-when-installing-matplotlib-with-pip-in-a-virtualenv-on-debian-whe > > Thanks! |
From: Cristóbal G. <kir...@gm...> - 2013-11-18 23:10:05
|
Hi I'm trying to install matplotlib in debian wheezy. But I get the following error: GotoBLAS : Architecture Initialization failed. No initialization function found. I can't find anything useful in google. You can find more details of my question in: http://stackoverflow.com/questions/20058653/gotoblas-error-when-installing-matplotlib-with-pip-in-a-virtualenv-on-debian-whe Thanks! |
From: Valentine C. J. <Jo....@na...> - 2013-11-18 21:58:41
|
Does your "existing solution" allow embedding SVG or PDF files? It sounds to me like what you need is an image that is a higher resolution but without changing the size it appears to be on the display. And if that's the case, then either you need a vector image format (thus SVG or PDF, or perhaps EPS), or otherwise you're up against the physical size of each pixel in your display, which is well beyond the reach of any software. Hope this helps! -jo On 11/18/13 3:31 PM, "Bradley Coleman" <col...@se...> wrote: >Chad and Alan, yes that¹s the problem. Thanks for responding. > >³If you like the way the image appears on screen, use the DPI argument to >savefig()² > >I don¹t exactly understand this. What do you mean on screen? This code >is >integrated with a big project that I¹m running inside of ecplise, so I¹m >not >sure what you mean by on screen? Either way, when I add and change a DPI >argument to savefig(), it just blows up the dimensions of the PNG. > >³My question back to you is, why does it matter? Most layout programs >will >let you set the physical size of the figure and scale the DPI to match.² > >So you¹re saying, fine let it produce a huge png and then shrink it with >the >html img tag and that will do the job, right? Well, that¹s really hard >for >us to do because we¹re using an existing solution and changing that will >involve lawyers, I kid you not. > >So, I can increase the DPI on the savefig call and correspondingly shrink >the dimensions of the file in inches to get it to stay the same size, but >the problem is the text and the lines, and the axis tick marks don¹t >shrink >too, which is really frustrating. I can then shrink the fonts, but I >don¹t >know how to shrink the tick marks and the lines. Anyways, it really seems >like there should be an easier way to increase resolution not to appear >unappreciative in any way of the hard work the devs put into this >excellent >project! > >Alan, I read about pixel size in that link you sent me and I have no idea >what to do. Perhaps you guys can have a look at my code? > >Thanks! >Bradley > > > > >from matplotlib.pyplot import figure, cm >from numpy import arange > ># Determine array sizes depending on input data set >topOfGradientColor = cm.colors.hex2color('#B5DBEF') >bottomOfGradientColor = wht = cm.colors.hex2color('#FFFFFF') >blumd = cm.colors.hex2color('#6BC3DE') >bludk = cm.colors.hex2color('#6396A5') >redmd = cm.colors.hex2color('#F7B27B') >reddk = cm.colors.hex2color('#E7754A') >gradientColorMap = >cm.colors.LinearSegmentedColormap.from_list('gradientColorMap', >[bottomOfGradientColor, topOfGradientColor], 256) >blugrd = >cm.colors.LinearSegmentedColormap.from_list('blugrd',[blumd,bludk],256) >blugrd_r = >cm.colors.LinearSegmentedColormap.from_list('blugrd_r',[bludk,blumd],256) >redgrd = >cm.colors.LinearSegmentedColormap.from_list('redgrd',[redmd,reddk],256) >redgrd_r = >cm.colors.LinearSegmentedColormap.from_list('redgrd_r',[reddk,redmd],256) > >numYears = len(barChartData) >xMin = -0.3 >xMax = numYears + 0.3 >xLim = (xMin, xMax) >paddingFactor = max(abs(yMin), abs(yMax)) * 0.18 >yLim = (yMin- paddingFactor, yMax + paddingFactor) > >fig = figure(figsize = (numYears*0.75, 3.5)) > ># Determine actual plot area >subplot = fig.add_subplot(111, xlim=xLim, ylim=yLim, autoscale_on=False >,axisbg=wht) >subplot.imshow([[.7, .7],[.5,.5]], interpolation='bicubic', >cmap=gradientColorMap, \ > extent=(xMin, xMax, yMin - paddingFactor, yMax + paddingFactor), >alpha=1) > ># Create bars on chart >values = [tuple[1] for tuple in barChartData] >labels = ["'" + str(tuple[0])[2:] for tuple in barChartData] > >xArray = arange(numYears) + 0.25 >width=0.5 > ># Create bars and bar labels, adjusting for pos/neg values >bottom = 0 >X = [[.6, .3],[.6,.3]] >for left,top in zip(xArray, values): > right = left + width > strlab = "{0:.2f}".format(top) + '%' > if top >= 0: > subplot.imshow(X, interpolation='bicubic', cmap=blugrd, >extent=(left, left+(width/2.0)+.01, bottom, top), alpha=1) > subplot.imshow(X, interpolation='bicubic', cmap=blugrd_r, >extent=(left+(width/2.0), right, bottom, top), alpha=1) > subplot.text(left+width/2., top + (paddingFactor/5), strlab, >ha='center', va='bottom', fontsize=8, family='serif') > else: > subplot.imshow(X, interpolation='bicubic', cmap=redgrd, >extent=(left, left+(width/2.0)+.01, bottom, top), alpha=1) > subplot.imshow(X, interpolation='bicubic', cmap=redgrd_r, >extent=(left+(width/2.0), right, bottom, top), alpha=1) > subplot.text(left+width/2., top - (paddingFactor/1.5), strlab, >ha='center', va='bottom', fontsize=8, family='serif') > >subplot.set_xticks(xArray + width / 2) #sets x ticks >subplot.set_xticklabels(labels, fontsize=8, family='serif') # sets x >labels >subplot.set_yticks([], minor=True) # minor=True means that it dynamically >assigns tick values >for lab in subplot.get_yticklabels(): # set_yticks doesn't accept font >args, >so we manually set them here > lab.set_fontsize(8) > lab.set_family('serif') > >subplot.hlines(0, -0.3, numYears + 0.3) # this is the horizontal line set >to >zero > >subplot.set_aspect('auto') # really no idea what this does. > >fig.savefig(fileNameBase + '/barchart.png', bbox_inches='tight', dpi=300) > > > >-------------------------------------------------------------------------- >---- >Shape the Mobile Experience: Free Subscription >Software experts and developers: Be at the forefront of tech innovation. >Intel(R) Software Adrenaline delivers strategic insight and game-changing >conversations that shape the rapidly evolving mobile landscape. Sign up >now. >http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktr >k >_______________________________________________ >Matplotlib-users mailing list >Mat...@li... >https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Alan G I. <ala...@gm...> - 2013-11-18 21:48:29
|
On 11/18/2013 3:31 PM, Bradley Coleman wrote: > when I add and change a DPI > argument to savefig(), it just blows up the dimensions of the PNG This is how I understand things, but I'm just a user. Matplotlib interprets ``dpi`` as ``pixels per inch``. PNG is a (compressed) bitmap format, so it maps to a rectangle of pixels. You are trying to set dpi, figure size in inches, and figure size in pixels independently. That's a no go. Any two will determine the 3rd. This is algebra, not a Matplotlib limitation. I ideally you will determine what you need your figure size to be **in pixels**, and then produce this when you make your figure. For example, if you want a 760x760 image, you could set the image size to say 5x5 and the dpi to 152. If you want to shrink or increase the size of a given figure, there are two ways to do it: - change dpi, which will scale everthing (including lines and fonts) - change fig size, which will leave lines and fonts the same size So if you have a target size in pixels (e.g., 760x760) and an existing figure, you have to decide whether you care about the fig size or keeping your lines and fonts the same size. However, if you are changing a bunch of figures in exactly the same fashion, you may be able to get what you want by changing the default settings to linewidth. You mentioned tick marks in particular. See the TICKS section of http://matplotlib.org/users/customizing.html (These can also be set on a per file basis, but that's a hassle.) hth, Alan Isaac |
From: Bradley C. <col...@se...> - 2013-11-18 20:31:56
|
Chad and Alan, yes that’s the problem. Thanks for responding. “If you like the way the image appears on screen, use the DPI argument to savefig()” I don’t exactly understand this. What do you mean on screen? This code is integrated with a big project that I’m running inside of ecplise, so I’m not sure what you mean by on screen? Either way, when I add and change a DPI argument to savefig(), it just blows up the dimensions of the PNG. “My question back to you is, why does it matter? Most layout programs will let you set the physical size of the figure and scale the DPI to match.” So you’re saying, fine let it produce a huge png and then shrink it with the html img tag and that will do the job, right? Well, that’s really hard for us to do because we’re using an existing solution and changing that will involve lawyers, I kid you not. So, I can increase the DPI on the savefig call and correspondingly shrink the dimensions of the file in inches to get it to stay the same size, but the problem is the text and the lines, and the axis tick marks don’t shrink too, which is really frustrating. I can then shrink the fonts, but I don’t know how to shrink the tick marks and the lines. Anyways, it really seems like there should be an easier way to increase resolution – not to appear unappreciative in any way of the hard work the devs put into this excellent project! Alan, I read about pixel size in that link you sent me and I have no idea what to do. Perhaps you guys can have a look at my code? Thanks! Bradley from matplotlib.pyplot import figure, cm from numpy import arange # Determine array sizes depending on input data set topOfGradientColor = cm.colors.hex2color('#B5DBEF') bottomOfGradientColor = wht = cm.colors.hex2color('#FFFFFF') blumd = cm.colors.hex2color('#6BC3DE') bludk = cm.colors.hex2color('#6396A5') redmd = cm.colors.hex2color('#F7B27B') reddk = cm.colors.hex2color('#E7754A') gradientColorMap = cm.colors.LinearSegmentedColormap.from_list('gradientColorMap', [bottomOfGradientColor, topOfGradientColor], 256) blugrd = cm.colors.LinearSegmentedColormap.from_list('blugrd',[blumd,bludk],256) blugrd_r = cm.colors.LinearSegmentedColormap.from_list('blugrd_r',[bludk,blumd],256) redgrd = cm.colors.LinearSegmentedColormap.from_list('redgrd',[redmd,reddk],256) redgrd_r = cm.colors.LinearSegmentedColormap.from_list('redgrd_r',[reddk,redmd],256) numYears = len(barChartData) xMin = -0.3 xMax = numYears + 0.3 xLim = (xMin, xMax) paddingFactor = max(abs(yMin), abs(yMax)) * 0.18 yLim = (yMin- paddingFactor, yMax + paddingFactor) fig = figure(figsize = (numYears*0.75, 3.5)) # Determine actual plot area subplot = fig.add_subplot(111, xlim=xLim, ylim=yLim, autoscale_on=False ,axisbg=wht) subplot.imshow([[.7, .7],[.5,.5]], interpolation='bicubic', cmap=gradientColorMap, \ extent=(xMin, xMax, yMin - paddingFactor, yMax + paddingFactor), alpha=1) # Create bars on chart values = [tuple[1] for tuple in barChartData] labels = ["'" + str(tuple[0])[2:] for tuple in barChartData] xArray = arange(numYears) + 0.25 width=0.5 # Create bars and bar labels, adjusting for pos/neg values bottom = 0 X = [[.6, .3],[.6,.3]] for left,top in zip(xArray, values): right = left + width strlab = "{0:.2f}".format(top) + '%' if top >= 0: subplot.imshow(X, interpolation='bicubic', cmap=blugrd, extent=(left, left+(width/2.0)+.01, bottom, top), alpha=1) subplot.imshow(X, interpolation='bicubic', cmap=blugrd_r, extent=(left+(width/2.0), right, bottom, top), alpha=1) subplot.text(left+width/2., top + (paddingFactor/5), strlab, ha='center', va='bottom', fontsize=8, family='serif') else: subplot.imshow(X, interpolation='bicubic', cmap=redgrd, extent=(left, left+(width/2.0)+.01, bottom, top), alpha=1) subplot.imshow(X, interpolation='bicubic', cmap=redgrd_r, extent=(left+(width/2.0), right, bottom, top), alpha=1) subplot.text(left+width/2., top - (paddingFactor/1.5), strlab, ha='center', va='bottom', fontsize=8, family='serif') subplot.set_xticks(xArray + width / 2) #sets x ticks subplot.set_xticklabels(labels, fontsize=8, family='serif') # sets x labels subplot.set_yticks([], minor=True) # minor=True means that it dynamically assigns tick values for lab in subplot.get_yticklabels(): # set_yticks doesn't accept font args, so we manually set them here lab.set_fontsize(8) lab.set_family('serif') subplot.hlines(0, -0.3, numYears + 0.3) # this is the horizontal line set to zero subplot.set_aspect('auto') # really no idea what this does. fig.savefig(fileNameBase + '/barchart.png', bbox_inches='tight', dpi=300) |
From: Gregorio B. <gre...@gm...> - 2013-11-18 11:25:27
|
Hi, I experienced similar error under python 2.7.5 win32 after dirty-upgrading from mpl 1.2.1 to 1.3.1 (w/o first removing the old version). A clean install solved the problem. Cheers, Gregorio |
From: Alan G I. <ala...@gm...> - 2013-11-17 14:03:02
|
See the discussion of pixel size at http://wiki.scipy.org/Cookbook/Matplotlib/AdjustingImageSize Alan Isaac |
From: Chad K. <cck...@gm...> - 2013-11-17 04:38:01
|
Let me see if I understand this right, you want to leave the image dimensions, in inches, constant while increasing the resolution in DPI to get a sharper image. Did I get that correct? If you like the way the image appears on screen, use the DPI argument to savefig(). My experience is that if you change the DPI when creating the figure, that will change the layout. What it sounds like you are seeing is that when you crank the DPI up, the PNG you created does not change its listed DPI, and displays larger. I checked on my system, matplotlib 1.1.1, and it is updating the DPI in the PNG files. My question back to you is, why does it matter? Most layout programs will let you set the physical size of the figure and scale the DPI to match. On Nov 16, 2013 3:06 PM, "Bradley Coleman" <col...@se...> wrote: > Hi there, I make a figure, then I do some stuff, then I save the figure. > > stuff > fig = figure(figsize = (0.75, 3.5)) > stuff > fig.savefig(‘name.png’, bbox_inches='tight') > > My figure is perfect, but I'm having trouble increasing the resolution. > There are two ways that I can figure out to do that, one is send a dpi as > an > argument to figure() and the other to savefig(). Sending it to figure() > doesn’t change the file at all, so I'm not sure what it does, but sending > it > to savefig() does change the file. When I send dpi to savefig(), like > dpi=500, the resolution seems to get much better, and the file size grows, > but the problem is that the height and width of the picture grows too. I > want the resolution to go up, but not the height and width of the picture. > What can I do? > > Thanks! > Bradley > > > > > ------------------------------------------------------------------------------ > DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps > OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access > Free app hosting. Or install the open source package on any LAMP server. > Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! > http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Bradley C. <col...@se...> - 2013-11-16 22:05:11
|
Hi there, I make a figure, then I do some stuff, then I save the figure. stuff fig = figure(figsize = (0.75, 3.5)) stuff fig.savefig(‘name.png’, bbox_inches='tight') My figure is perfect, but I'm having trouble increasing the resolution. There are two ways that I can figure out to do that, one is send a dpi as an argument to figure() and the other to savefig(). Sending it to figure() doesn’t change the file at all, so I'm not sure what it does, but sending it to savefig() does change the file. When I send dpi to savefig(), like dpi=500, the resolution seems to get much better, and the file size grows, but the problem is that the height and width of the picture grows too. I want the resolution to go up, but not the height and width of the picture. What can I do? Thanks! Bradley |
From: Benjamin R. <ben...@ou...> - 2013-11-15 19:47:28
|
On Wed, Nov 13, 2013 at 8:16 PM, Ted To <rai...@th...> wrote: > Thanks Ben! > > I was wondering if you can help me with a related question. How does > one change the artist for the legend? Since I have a "step" histogram, > it would be nice to have the legend display lines rather than outlined > rectangles. > > Thanks, > Ted > > I am not really an expert on that topic, but this question (or one very similar) has come up before. I think the answer is to use "Proxy Artists". If you search for proxy artists in the documentation, you should find stuff about that. Cheers! Ben Root |
From: Damon M. <dam...@gm...> - 2013-11-14 15:35:24
|
The matplotlib calendar claims there is a hangout today, but I can't find an invite on Google+. Am I missing something or was it cancelled? -- Damon McDougall http://www.damon-is-a-geek.com Institute for Computational Engineering Sciences 201 E. 24th St. Stop C0200 The University of Texas at Austin Austin, TX 78712-1229 |
From: Ted To <rai...@th...> - 2013-11-14 01:16:40
|
Thanks Ben! I was wondering if you can help me with a related question. How does one change the artist for the legend? Since I have a "step" histogram, it would be nice to have the legend display lines rather than outlined rectangles. Thanks, Ted On 11/13/2013 09:35 AM, Benjamin Root wrote: > > > > On Tue, Nov 12, 2013 at 8:01 PM, Ted To <rai...@th... > <mailto:rai...@th...>> wrote: > > Perfect! Many thanks! Seems to be an undocumented feature... > > > Not undocumented. In the docs for hist(), it says that it accepts any > parameter that is used for Patch artists. This is also generally true > for many of the other plotting functions. They usually take any > additional keyword arguments that could be passed on to whatever the > artist is that is returned. This isn't a hard-and-fast rule, but it is > true more often than not. > > > > Out of curiosity, what is the rationale behind using 'dashed' and > 'dashdot' instead of '--' and '-.'? > > > This is an inadvertent oversight. I noted this in > https://github.com/matplotlib/matplotlib/issues/2136 > > Cheers! > Ben Root |
From: Eric F. <ef...@ha...> - 2013-11-14 00:03:04
|
On 2013/11/13 11:40 AM, robertdcurrier wrote: > I've pulled my hair out for the past day trying to solve this problem and > have done extensive searches to no avail. Here's my situation: > > I have data from an autonomous underwater vehicle. I have three np arrays to > plot: > 1) time on the x axis > 2) vehicle depth on the y axis > 3) sensor reading to set the color for the scatter plot at time/depth point. > > Unfortunately for me the vehicle reports sensors at different rates which > means that I might have a time and depth stamp with a 'NaN' for the sensor > value. The x/y portion of scatter deals with the NaNs with no problem, but > when I call scatter(time, depth, c=mySensorArray) and mySensorArray contains > a 'NaN' matplotlib borks. I have not been able to come up with a method > to allow the values of the sensor being plotted to set the color of the > scatter or skip the entry when the value is a 'NaN'. mySensorArray = np.ma.masked_invalid(mySensorArray) Eric |
From: robertdcurrier <rob...@gm...> - 2013-11-13 21:40:46
|
I've pulled my hair out for the past day trying to solve this problem and have done extensive searches to no avail. Here's my situation: I have data from an autonomous underwater vehicle. I have three np arrays to plot: 1) time on the x axis 2) vehicle depth on the y axis 3) sensor reading to set the color for the scatter plot at time/depth point. Unfortunately for me the vehicle reports sensors at different rates which means that I might have a time and depth stamp with a 'NaN' for the sensor value. The x/y portion of scatter deals with the NaNs with no problem, but when I call scatter(time, depth, c=mySensorArray) and mySensorArray contains a 'NaN' matplotlib borks. I have not been able to come up with a method to allow the values of the sensor being plotted to set the color of the scatter or skip the entry when the value is a 'NaN'. What complicates the matter is that we're only gathering data on the upward profile of the vehicle. Until recently we collected data on both up and down legs of the Yo, so I was able to simply interpolate and fill in the NaN values with the interpolated result and achieve gorgeous scatter plots. That doesn't work when the data stops being gathered at the top of the Yo... interpolating simply repeats the last value all the way back down to the bottom when data values start getting collected again. Thanks for any pointers... I'm really stumped. Bob Currier -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Scatterplot-c-arg-and-NaN-values-autonomous-underwater-vehicle-tp42494.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Patrick B. <pat...@gm...> - 2013-11-13 14:56:28
|
Hello everyone, so I've run into a bit of a problem while embedding a matplotlib plot into a GTK3 application. Everything's working fine as always, except the scroll_event seems to get stuck somewhere and my callback is never called. The button_press_event works. Apologies in advance if I missed something, but something somewhere doesn't seem to be quite right. Please let me know if I need to file a bug report? Minimal example to demonstrate the problem: [1] With pyplot it works just fine: [2] Regards, Patrick [1] GTK3Agg minimal example from gi.repository import Gtk, Gdk from matplotlib.figure import Figure from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigCanvas def on_press(canvas, event): print "press!" def on_scroll(canvas, event): print "scroll!" window = Gtk.Window() window.connect("delete-event", Gtk.main_quit) figure = Figure(figsize=(5,4), dpi=100) plot = figure.add_subplot(111) plot.plot([0,0.5,2]) canvas = FigCanvas(figure) canvas.connect('button_press_event', on_press) canvas.connect('scroll_event', on_scroll) window.add(canvas) window.show_all() Gtk.main() [2] pyplot minimal example import matplotlib.pyplot as plt plt.plot([0,0.5,2]) fig = plt.gcf() def on_click(event): print "press!" def on_scroll(event): print "scroll!" fig.canvas.mpl_connect('button_press_event', on_click) fig.canvas.mpl_connect('scroll_event', on_scroll) plt.show() |
From: Benjamin R. <ben...@ou...> - 2013-11-13 14:36:24
|
On Tue, Nov 12, 2013 at 8:01 PM, Ted To <rai...@th...> wrote: > Perfect! Many thanks! Seems to be an undocumented feature... > > Not undocumented. In the docs for hist(), it says that it accepts any parameter that is used for Patch artists. This is also generally true for many of the other plotting functions. They usually take any additional keyword arguments that could be passed on to whatever the artist is that is returned. This isn't a hard-and-fast rule, but it is true more often than not. > Out of curiosity, what is the rationale behind using 'dashed' and > 'dashdot' instead of '--' and '-.'? > > This is an inadvertent oversight. I noted this in https://github.com/matplotlib/matplotlib/issues/2136 Cheers! Ben Root |
From: suinonatante <lui...@ya...> - 2013-11-13 14:00:17
|
Hi, i'm trying to use "\color" command in text (setting 'text.usetex' = True and rc('text.latex', preamble='\usepackage{color}')) to color only a part of entire string; it works with PS backend, with other backends font color is overwritten by default rc color. is it a bug? is there a way to use "\color" with other backends? thanks in advance. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Latex-color-command-works-only-with-PS-backend-tp42490.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Ted To <rai...@th...> - 2013-11-13 01:02:05
|
Perfect! Many thanks! Seems to be an undocumented feature... Out of curiosity, what is the rationale behind using 'dashed' and 'dashdot' instead of '--' and '-.'? Ted To On 11/12/2013 04:59 PM, Benjamin Root wrote: > > > > On Tue, Nov 12, 2013 at 4:26 PM, Ted To <rai...@th... > <mailto:rai...@th...>> wrote: > > Hi, > > Is there an option to change the line style for the outline of histogram > bars? What I am looking for some something like the attached kernel > density plot. I can set different colors (attached) but this is not > very useful when printing in black and white. > > Thanks, > Ted To > > > You should be able to specify linestyle='dashed' (or 'dashdot', or > 'dotted') when you call hist(). > > I hope that helps! > Ben Root |