SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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

Showing 7 results of 7

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 that1s the problem. Thanks for responding.
>
>3If you like the way the image appears on screen, use the DPI argument to
>savefig()2
>
>I don1t exactly understand this. What do you mean on screen? This code
>is
>integrated with a big project that I1m running inside of ecplise, so I1m
>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.
>
>3My 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.2
>
>So you1re 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, that1s really hard
>for
>us to do because we1re 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 don1t
>shrink
>too, which is really frustrating. I can then shrink the fonts, but I
>don1t
>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)
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

Showing 7 results of 7

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /