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
(6)
2
(29)
3
(19)
4
(6)
5
(5)
6
(9)
7
(9)
8
(19)
9
(14)
10
(19)
11
(26)
12
(10)
13
(26)
14
(22)
15
(19)
16
(17)
17
(16)
18
(2)
19
20
(1)
21
(1)
22
(10)
23
(11)
24
(17)
25
(6)
26
(1)
27
28
(9)
29
(9)
30
(9)



Showing 25 results of 25

Very odd. Given there's no C++ changes here, I'm very surprised. 
Shooting in the dark here: does deleting ~/.matplotlib/fontList.cache 
help at all?
Mike
On 11/11/2011 05:34 PM, Friedrich Romstedt wrote:
> 2011年11月11日 Michael Droettboom<md...@st...>:
>> Running bisect in this way, did you arrive at a more conclusive
>> determination about which commit may have introduced the problem?
> Yes, do you know Final Fantasy? "You gonna loose it ... Tracking ...
> Tracking ... Found it." af9954d46e.
>
> I don't know which part of that commit breaks it, maybe you can have a
> look? It's a commit by you. Maybe it's just the evil font cache. :-)
>
> It's not the ft2font, notably, this was apparently imported properly;
> it's just some initialisation code of matplotlib that seems to fail
> while importing matplotlib.figure.
>
> I verified clearly; the commit mentioned fails, and its predecessor succeeds.
>
> I did patch the _png.cpp to make it work; it didn't comply with
> libpng-1.4 that time.
>
> I can upload the branches for testing the two commits to my repo.
>
> So far,
> Friedrich
2011年11月11日 Michael Droettboom <md...@st...>:
> Running bisect in this way, did you arrive at a more conclusive
> determination about which commit may have introduced the problem?
Yes, do you know Final Fantasy? "You gonna loose it ... Tracking ...
Tracking ... Found it." af9954d46e.
I don't know which part of that commit breaks it, maybe you can have a
look? It's a commit by you. Maybe it's just the evil font cache. :-)
It's not the ft2font, notably, this was apparently imported properly;
it's just some initialisation code of matplotlib that seems to fail
while importing matplotlib.figure.
I verified clearly; the commit mentioned fails, and its predecessor succeeds.
I did patch the _png.cpp to make it work; it didn't comply with
libpng-1.4 that time.
I can upload the branches for testing the two commits to my repo.
So far,
Friedrich
From: Michael D. <md...@st...> - 2011年11月11日 21:02:06
Have you tried removing the build directory and install directories to 
force a full rebuild? It sounds like the build or install got stuck at 
some point. I've never seen it not copy *.py files in a package before.
Mike
On 11/11/2011 03:12 PM, David Welch wrote:
> Update: test folders are in the build directory, they are just not
> being copied during build.
>
> *bump*
>
> On 11/10/11, David Welch<dav...@gm...> wrote:
>> Hello,
>>
>> I am installing matplotlib on Snow Leopard 10.6. I downloaded v1.1.0 from
>> the sourceforge site and installed in this manner:
>>
>> ############################
>>
>> $ export CFLAGS="-arch i386 -arch x86_64 -I/usr/X11/include
>> -I/usr/X11/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk"
>> $ export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch
>> x86_64 -L/usr/X11/lib -syslibroot,/Developer/SDKs/MacOSX10.6.sdk"
>> $ export FFLAGS="-arch i386 -arch x86_64"
>> $ tar -xf matplotlib-1.1.0.tar.gz
>> $ cd matplotlib-1.1.0
>> $ python setup.py build
>> $ python setup.py install
>> $
>> $ python
>>>>> import matplotlib as mpl
>>>>> mpl.test("1")
>> ...........EEEEEEEEEEE
>> ======================================================================
>> ERROR: Failure: AttributeError ('module' object has no attribute
>> 'test_backend_svg')
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>> File "/private/tmp/test/lib/python2.6/site-packages/nose/loader.py", line
>> 379, in loadTestsFromName
>> module = resolve_name(addr.module)
>> File "/private/tmp/test/lib/python2.6/site-packages/nose/util.py", line
>> 331, in resolve_name
>> obj = getattr(obj, part)
>> AttributeError: 'module' object has no attribute 'test_backend_svg'
>>
>> (etc.)
>> #############################
>>
>> The failure is for all modules in matplotlib.tests except for test_agg,
>> test_cbook, test_mlab, and test_transform.
>>
>> Is the sourceforge achive incomplete?
>>
>> -Dave
>>
>> --
>> David Welch
>> dav...@gm...
>>
>>
>>
>>
>
From: magurling <mag...@gm...> - 2011年11月11日 20:40:33
I updated matplotlib to 1.1.0; both methods work now. I would say "Thanks
Paul and Francesco" but I just read the mailing list etiquette.
-- 
View this message in context: http://old.nabble.com/legend-border%2C-frameon-keyword-tp32807933p32828355.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: David W. <dav...@gm...> - 2011年11月11日 20:12:20
Update: test folders are in the build directory, they are just not
being copied during build.
*bump*
On 11/10/11, David Welch <dav...@gm...> wrote:
> Hello,
>
> I am installing matplotlib on Snow Leopard 10.6. I downloaded v1.1.0 from
> the sourceforge site and installed in this manner:
>
> ############################
>
> $ export CFLAGS="-arch i386 -arch x86_64 -I/usr/X11/include
> -I/usr/X11/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk"
> $ export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch
> x86_64 -L/usr/X11/lib -syslibroot,/Developer/SDKs/MacOSX10.6.sdk"
> $ export FFLAGS="-arch i386 -arch x86_64"
> $ tar -xf matplotlib-1.1.0.tar.gz
> $ cd matplotlib-1.1.0
> $ python setup.py build
> $ python setup.py install
> $
> $ python
>>>> import matplotlib as mpl
>>>> mpl.test("1")
> ...........EEEEEEEEEEE
> ======================================================================
> ERROR: Failure: AttributeError ('module' object has no attribute
> 'test_backend_svg')
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/private/tmp/test/lib/python2.6/site-packages/nose/loader.py", line
> 379, in loadTestsFromName
> module = resolve_name(addr.module)
> File "/private/tmp/test/lib/python2.6/site-packages/nose/util.py", line
> 331, in resolve_name
> obj = getattr(obj, part)
> AttributeError: 'module' object has no attribute 'test_backend_svg'
>
> (etc.)
> #############################
>
> The failure is for all modules in matplotlib.tests except for test_agg,
> test_cbook, test_mlab, and test_transform.
>
> Is the sourceforge achive incomplete?
>
> -Dave
>
> --
> David Welch
> dav...@gm...
>
>
>
>
-- 
Dept. of Psychiatry
Dept. of Biomedical Engineering
University of Iowa
From: Paul I. <piv...@gm...> - 2011年11月11日 19:44:44
>> On Fri, Nov 11, 2011 at 8:53 AM, Paul Ivanov <piv...@gm...> wrote:
>>> might you be on an old matplotlib.__version__?
On Fri, Nov 11, 2011 at 11:18 AM, magurling <mag...@gm...> wrote:
> This is probably it. I installed by "apt-get install" but keep getting
> version 0.99.3 installed.
> I need to install a more recent version before I trouble anyone further.
> Which version are you using Paul?
1.2.0dev from Git :), but you will be fine with the latest stable (v1.1.0)
see http://matplotlib.sourceforge.net/users/installing.html#installing-from-source
best,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
From: Rahul M. <aer...@gm...> - 2011年11月11日 19:44:39
Hi,
Is there such a thing "Python / Matplotlib Central Exchange" similar to the
"File Exchange on Matlab Central" (
http://www.mathworks.com/matlabcentral/fileexchange/ ) that anyone is
aware of which allows one to search for user-contributed functions /
packages.
Many Thanks!
From: magurling <mag...@gm...> - 2011年11月11日 19:18:11
This is probably it. I installed by "apt-get install" but keep getting
version 0.99.3 installed.
I need to install a more recent version before I trouble anyone further.
Which version are you using Paul?
Paul Ivanov wrote:
> 
> Oops, didn't reply to list last time:
> 
> On Fri, Nov 11, 2011 at 8:53 AM, Paul Ivanov <piv...@gm...> wrote:
>> On Tue, Nov 8, 2011 at 4:49 PM, magurling <mag...@gm...> wrote:
>>>
>>> I want a legend without the black border. I've tried a few things that
>>> have
>>> been suggested on this forum and elsewhere to no avail. According to
>>> what
>>> I've seen, it should be as simple as:
>>
>> Your example works as intended here.
>>
>>
>>> It must be something simple that I am doing wrong. Any ideas?
>>
>> might you be on an old matplotlib.__version__?
> 
> 
> best,
> -- 
> Paul Ivanov
> 314 address only used for lists, off-list direct email at:
> http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
> 
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save 700ドル by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/legend-border%2C-frameon-keyword-tp32807933p32827837.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: magurling <mag...@gm...> - 2011年11月11日 19:15:13
Thanks Francesco, but I've also tried to use the "draw_frame(False)" method
with no luck.
montefra wrote:
> 
> Hi,
> 
> I usually do like this
> 
> l = ax.legend( (rects1[0], rects2[0]), ('set1', 'set2'))
> l.draw_frame(False)
> 
> Cheers,
> 
> Francesco
> 
> 2011年11月9日 magurling <mag...@gm...>:
>>
>> I want a legend without the black border. I've tried a few things that
>> have
>> been suggested on this forum and elsewhere to no avail. According to what
>> I've seen, it should be as simple as:
>>
>> import matplotlib.pyplot as plt
>> import numpy as np
>>
>> N = 5
>> Means1 = (20, 35, 30, 35, 27)
>> Means2 = (25, 32, 34, 20, 25)
>>
>> ind = np.arange(N) # the x locations for the groups
>> width = 0.20    # the width of the bars
>>
>> fig = plt.figure()
>> ax = fig.add_subplot(111)
>> rects1 = ax.bar(ind, Means1, width, color='k')
>> rects2 = ax.bar(ind+width, Means2, width, color='w')
>>
>> ax.legend( (rects1[0], rects2[0]), ('set1', 'set2'), frameon=False )
>>
>> plt.show()
>>
>>
>> It all works except for "frameon=False"
>>
>> I get this:
>>
>> /usr/lib/pymodules/python2.7/matplotlib/axes.pyc in legend(self, *args,
>> **kwargs)
>>  4042
>>  4043     handles = cbook.flatten(handles)
>> -> 4044     self.legend_ = mlegend.Legend(self, handles, labels,
>> **kwargs)
>>  4045     return self.legend_
>>  4046
>>
>> TypeError: __init__() got an unexpected keyword argument 'frameon'
>>
>> I've also checked my matplotlibrc under the "Legend" section and I don't
>> see
>> a "legend.frameon" line.
>>
>> It must be something simple that I am doing wrong. Any ideas?
>> --
>> View this message in context:
>> http://old.nabble.com/legend-border%2C-frameon-keyword-tp32807933p32807933.html
>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> RSA(R) Conference 2012
>> Save 700ドル by Nov 18
>> Register now
>> http://p.sf.net/sfu/rsa-sfdev2dev1
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
> 
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save 700ドル by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/legend-border%2C-frameon-keyword-tp32807933p32827812.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: klo uo <kl...@gm...> - 2011年11月11日 17:42:02
Thanks Johann,
that is exactly what I asked for
I knew that matplotlib can do GUI tricks but I didn't felt skilled to go
there. Seeing you code it seems easy now, but it's always like that after
you see the solution :D
Cheers
On Fri, Nov 11, 2011 at 6:05 PM, johanngoetz <jg...@uc...> wrote:
>
> I have this script that uses the matplotlib Slider object to control the
> colormap of a histogram. This could be very close to what you want. Here is
> the script:
>
> ### begin colormap_slider.py #################################
> import math, copy
> import numpy
> from matplotlib import pyplot, colors, cm
> from matplotlib.widgets import Slider
>
> def cmap_powerlaw_adjust(cmap, a):
> '''
> returns a new colormap based on the one given
> but adjusted via power-law:
>
> newcmap = oldcmap**a
> '''
> if a < 0.:
> return cmap
> cdict = copy.copy(cmap._segmentdata)
> fn = lambda x : (x[0]**a, x[1], x[2])
> for key in ('red','green','blue'):
> cdict[key] = map(fn, cdict[key])
> cdict[key].sort()
> assert (cdict[key][0]<0 or cdict[key][-1]>1), \
> "Resulting indices extend out of the [0, 1] segment."
> return colors.LinearSegmentedColormap('colormap',cdict,1024)
>
> def cmap_center_adjust(cmap, center_ratio):
> '''
> returns a new colormap based on the one given
> but adjusted so that the old center point higher
> (>0.5) or lower (<0.5)
> '''
> if not (0. < center_ratio) & (center_ratio < 1.):
> return cmap
> a = math.log(center_ratio) / math.log(0.5)
> return cmap_powerlaw_adjust(cmap, a)
>
> def cmap_center_point_adjust(cmap, range, center):
> '''
> converts center to a ratio between 0 and 1 of the
> range given and calls cmap_center_adjust(). returns
> a new adjusted colormap accordingly
> '''
> if not ((range[0] < center) and (center < range[1])):
> return cmap
> return cmap_center_adjust(cmap,
> abs(center - range[0]) / abs(range[1] - range[0]))
>
>
> if __name__ == '__main__':
> ### create some 2D histogram-type data
> def func3(x,y):
> return (1- x/2 + x**5 + y**3)*numpy.exp(-x**2-y**2)
> x = numpy.linspace(-3.0, 3.0, 60)
> y = numpy.linspace(-3.0, 3.0, 60)
> X,Y = numpy.meshgrid(x, y)
> Z = func3(X, Y)
> extent = [x[0],x[-1],y[0],y[-1]]
>
>
> plotkwargs = {
> 'extent' : extent,
> 'origin' : 'lower',
> 'interpolation' : 'nearest',
> 'aspect' : 'auto'}
>
> ### interactively adjustable with a slider
> fig = pyplot.figure(figsize=(6,4))
> fig.subplots_adjust(top=0.8)
> ax = fig.add_subplot(1,1,1)
> cmap = cm.seismic
> plt = ax.imshow(Z, cmap=cmap, **plotkwargs)
> cb = fig.colorbar(plt, ax=ax)
>
> axcmap = fig.add_axes([0.1, 0.85, 0.8, 0.05], axisbg='white')
> scmap = Slider(axcmap, '', 0.0, 1.0, valinit=0.5)
>
> def update(val):
> cmapcenter = scmap.val
> plt.set_cmap(cmap_center_adjust(cmap, cmapcenter))
> scmap.on_changed(update)
>
>
>
> pyplot.show()
> ### end colormap_slider.py ###################################
> --
> View this message in context:
> http://old.nabble.com/How-to-shift-colormap--tp32792283p32827012.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save 700ドル by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: johanngoetz <jg...@uc...> - 2011年11月11日 17:05:53
I have this script that uses the matplotlib Slider object to control the
colormap of a histogram. This could be very close to what you want. Here is
the script:
### begin colormap_slider.py #################################
import math, copy
import numpy
from matplotlib import pyplot, colors, cm
from matplotlib.widgets import Slider
def cmap_powerlaw_adjust(cmap, a):
 '''
 returns a new colormap based on the one given
 but adjusted via power-law:
 newcmap = oldcmap**a
 '''
 if a < 0.:
 return cmap
 cdict = copy.copy(cmap._segmentdata)
 fn = lambda x : (x[0]**a, x[1], x[2])
 for key in ('red','green','blue'):
 cdict[key] = map(fn, cdict[key])
 cdict[key].sort()
 assert (cdict[key][0]<0 or cdict[key][-1]>1), \
 "Resulting indices extend out of the [0, 1] segment."
 return colors.LinearSegmentedColormap('colormap',cdict,1024)
def cmap_center_adjust(cmap, center_ratio):
 '''
 returns a new colormap based on the one given
 but adjusted so that the old center point higher
 (>0.5) or lower (<0.5)
 '''
 if not (0. < center_ratio) & (center_ratio < 1.):
 return cmap
 a = math.log(center_ratio) / math.log(0.5)
 return cmap_powerlaw_adjust(cmap, a)
def cmap_center_point_adjust(cmap, range, center):
 '''
 converts center to a ratio between 0 and 1 of the
 range given and calls cmap_center_adjust(). returns
 a new adjusted colormap accordingly
 '''
 if not ((range[0] < center) and (center < range[1])):
 return cmap
 return cmap_center_adjust(cmap,
 abs(center - range[0]) / abs(range[1] - range[0]))
if __name__ == '__main__':
 ### create some 2D histogram-type data
 def func3(x,y):
 return (1- x/2 + x**5 + y**3)*numpy.exp(-x**2-y**2)
 x = numpy.linspace(-3.0, 3.0, 60)
 y = numpy.linspace(-3.0, 3.0, 60)
 X,Y = numpy.meshgrid(x, y)
 Z = func3(X, Y)
 extent = [x[0],x[-1],y[0],y[-1]]
 plotkwargs = {
 'extent' : extent,
 'origin' : 'lower',
 'interpolation' : 'nearest',
 'aspect' : 'auto'}
 ### interactively adjustable with a slider
 fig = pyplot.figure(figsize=(6,4))
 fig.subplots_adjust(top=0.8)
 ax = fig.add_subplot(1,1,1)
 cmap = cm.seismic
 plt = ax.imshow(Z, cmap=cmap, **plotkwargs)
 cb = fig.colorbar(plt, ax=ax)
 axcmap = fig.add_axes([0.1, 0.85, 0.8, 0.05], axisbg='white')
 scmap = Slider(axcmap, '', 0.0, 1.0, valinit=0.5)
 def update(val):
 cmapcenter = scmap.val
 plt.set_cmap(cmap_center_adjust(cmap, cmapcenter))
 scmap.on_changed(update)
 pyplot.show()
### end colormap_slider.py ###################################
-- 
View this message in context: http://old.nabble.com/How-to-shift-colormap--tp32792283p32827012.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Paul I. <piv...@gm...> - 2011年11月11日 17:05:40
Oops, didn't reply to list last time:
On Fri, Nov 11, 2011 at 8:53 AM, Paul Ivanov <piv...@gm...> wrote:
> On Tue, Nov 8, 2011 at 4:49 PM, magurling <mag...@gm...> wrote:
>>
>> I want a legend without the black border. I've tried a few things that have
>> been suggested on this forum and elsewhere to no avail. According to what
>> I've seen, it should be as simple as:
>
> Your example works as intended here.
>
>
>> It must be something simple that I am doing wrong. Any ideas?
>
> might you be on an old matplotlib.__version__?
best,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
From: Paul I. <piv...@gm...> - 2011年11月11日 17:04:20
On Wed, Nov 9, 2011 at 7:37 AM, Brent Pedersen <bpe...@gm...> wrote:
> Hi,
> I have an image like this:
> https://docs.google.com/open?id=0B7eMlcFeoB_rMTU1OTU0NmMtMzM3MC00YWI3LWFlNTYtNzg0MTM4MWI3OWMz
>
> with an axes inside of another. I'd like to set the background behind
> the labels of the inner figure.
> I've tried set_frame_on on the axis, set_frameon on the figure,
> axisbg_color, and so on.
Would it be sufficient to set the background color behind the text
labels? If 'ax' is your inner axes, do:
ax.yaxis.label.set_backgroundcolor('red')
ax.xaxis.label.set_backgroundcolor('red')
best,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
From: Francesco M. <fra...@go...> - 2011年11月11日 16:42:01
Hi,
I usually do like this
l = ax.legend( (rects1[0], rects2[0]), ('set1', 'set2'))
l.draw_frame(False)
Cheers,
Francesco
2011年11月9日 magurling <mag...@gm...>:
>
> I want a legend without the black border. I've tried a few things that have
> been suggested on this forum and elsewhere to no avail. According to what
> I've seen, it should be as simple as:
>
> import matplotlib.pyplot as plt
> import numpy as np
>
> N = 5
> Means1 = (20, 35, 30, 35, 27)
> Means2 = (25, 32, 34, 20, 25)
>
> ind = np.arange(N) # the x locations for the groups
> width = 0.20    # the width of the bars
>
> fig = plt.figure()
> ax = fig.add_subplot(111)
> rects1 = ax.bar(ind, Means1, width, color='k')
> rects2 = ax.bar(ind+width, Means2, width, color='w')
>
> ax.legend( (rects1[0], rects2[0]), ('set1', 'set2'), frameon=False )
>
> plt.show()
>
>
> It all works except for "frameon=False"
>
> I get this:
>
> /usr/lib/pymodules/python2.7/matplotlib/axes.pyc in legend(self, *args,
> **kwargs)
>  4042
>  4043     handles = cbook.flatten(handles)
> -> 4044     self.legend_ = mlegend.Legend(self, handles, labels,
> **kwargs)
>  4045     return self.legend_
>  4046
>
> TypeError: __init__() got an unexpected keyword argument 'frameon'
>
> I've also checked my matplotlibrc under the "Legend" section and I don't see
> a "legend.frameon" line.
>
> It must be something simple that I am doing wrong. Any ideas?
> --
> View this message in context: http://old.nabble.com/legend-border%2C-frameon-keyword-tp32807933p32807933.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save 700ドル by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Bedartha G. <go...@pi...> - 2011年11月11日 16:41:33
Hi,
>>
As a test, try to set your backend to either 'cocoaagg' or 'macosx' like so:
import matplotlib as mpl
mpl.use('cocoaagg')
There have been issues with TkAgg on macs. I have personally not had any success with it (even with ActiveState's Tcl).
>>
>>
> tried doing the above but this required me to install something called PyObjC:
>>> The CococaAgg backend required PyObjC to be installed!
> (currently testing v1.3.7)
> 
> when I tried to easy_install PyObjC it gave me the following error:
> 
> Unknown distribution option: 'use_2to3'
> warnings.warn(msg)
> error: Could not find required distribution pyobjc-core
>>
I am sorry for this but I easy_install-ed pyobjc-core, and then easy_install-ed PyObjC.
Now the pyplot.show() command works.
My matplotlib is now up and working!
Thank you, (esp ben.root)
Bedartha
From: Bedartha G. <go...@pi...> - 2011年11月11日 15:43:08
Sorry it seems that the group as a limit to mail size so I am resending the mail below without the attachment.
Begin forwarded message:
> From: Bedartha Goswami <go...@pi...>
> Subject: Re: [Matplotlib-users] Matplotlib "show()" error Mac OS X Lion
> Date: November 11, 2011 4:36:11 PM GMT+01:00
> To: mat...@li...
> 
> Hi,
> ---
> As a test, try to set your backend to either 'cocoaagg' or 'macosx' like so:
> 
> import matplotlib as mpl
> mpl.use('cocoaagg')
> ---
> 
> I tried doing the above but this required me to install something called PyObjC:
>>> The CococaAgg backend required PyObjC to be installed!
> (currently testing v1.3.7)
> 
> when I tried to easy_install PyObjC it gave me the following error:
> 
> Unknown distribution option: 'use_2to3'
> warnings.warn(msg)
> error: Could not find required distribution pyobjc-core
> 
> ----
>> I suspect you are trying to install matplotlib on the 64-bit Python 
> instead of the 32-bit python for which it was built
> ----
> Well, I do use the python-32 bit version for all the work and in fact, the bumpy and scipy have been built for the python-32 bit. and i am having trouble with matplotlib on this - in fact, none of the bumpy, scipy, and python etc modules even load on the 64-bit version.
> 
> ----
> Download and unpack the matplotlib source.
> Edit setupext.py and change the entry for darwin to include those two 
> directories: /usr/X11 and /usr/lib. 
> ----
> I did try this way as well, but the build does not manage to detect the libpng15 library in the X11 directory - somehow it uses "lpng15" marker and does not end up finding it when it is right there under X11's nose. I am attaching the detailed shell text for this step with this mail.
> 
> Regards,
> Bedartha
> 
From: Bedartha G. <go...@pi...> - 2011年11月11日 15:37:28
Hi,
---
As a test, try to set your backend to either 'cocoaagg' or 'macosx' like so:
import matplotlib as mpl
mpl.use('cocoaagg')
---
I tried doing the above but this required me to install something called PyObjC:
>>The CococaAgg backend required PyObjC to be installed!
 (currently testing v1.3.7)
when I tried to easy_install PyObjC it gave me the following error:
Unknown distribution option: 'use_2to3'
 warnings.warn(msg)
error: Could not find required distribution pyobjc-core
----
>I suspect you are trying to install matplotlib on the 64-bit Python 
instead of the 32-bit python for which it was built
----
Well, I do use the python-32 bit version for all the work and in fact, the bumpy and scipy have been built for the python-32 bit. and i am having trouble with matplotlib on this - in fact, none of the bumpy, scipy, and python etc modules even load on the 64-bit version.
----
Download and unpack the matplotlib source.
Edit setupext.py and change the entry for darwin to include those two 
directories: /usr/X11 and /usr/lib. 
----
I did try this way as well, but the build does not manage to detect the libpng15 library in the X11 directory - somehow it uses "lpng15" marker and does not end up finding it when it is right there under X11's nose. I am attaching the detailed shell text for this step with this mail.
Regards,
Bedartha
From: klo uo <kl...@gm...> - 2011年11月11日 15:21:39
Or are matplotlib colormaps compatible with any other programs?
On Fri, Nov 11, 2011 at 4:19 PM, klo uo <kl...@gm...> wrote:
>
> So I want to ask this question differently: Is there some tool (Inkscape,
> CorelDraw, Photoshop, ... anything) that would let me use GUI with some
> sliders so that I can try adjust matplotlib colormap?
>
From: klo uo <kl...@gm...> - 2011年11月11日 15:19:27
I learned some more about matplotlib colormaps from here:
http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps
and tried to grasp cmap creation workflow.
Here is GMT_haxby:
_GMT_haxby_data = {
'blue': [
(0.0, 0.474509805441, 0.474509805441),
(0.0322580635548, 0.588235318661, 0.588235318661),
(0.0645161271095, 0.686274528503, 0.686274528503),
(0.0967741906643, 0.784313738346, 0.784313738346),
(0.129032254219, 0.831372559071, 0.831372559071),
(0.161290317774, 0.878431379795, 0.878431379795),
(0.193548381329, 0.941176474094, 0.941176474094),
(0.225806444883, 0.972549021244, 0.972549021244),
(0.258064508438, 1.0, 1.0),
(0.290322571993, 1.0, 1.0),
(0.322580635548, 1.0, 1.0),
(0.354838699102, 0.941176474094, 0.941176474094),
(0.387096762657, 0.882352948189, 0.882352948189),
(0.419354826212, 0.784313738346, 0.784313738346),
(0.451612889767, 0.68235296011, 0.68235296011),
(0.483870953321, 0.658823549747, 0.658823549747),
(0.516129016876, 0.635294139385, 0.635294139385),
(0.548387110233, 0.552941203117, 0.552941203117),
(0.580645143986, 0.474509805441, 0.474509805441),
(0.612903237343, 0.407843142748, 0.407843142748),
(0.645161271095, 0.341176480055, 0.341176480055),
(0.677419364452, 0.270588248968, 0.270588248968),
(0.709677398205, 0.29411765933, 0.29411765933),
(0.741935491562, 0.305882364511, 0.305882364511),
(0.774193525314, 0.352941185236, 0.352941185236),
(0.806451618671, 0.486274510622, 0.486274510622),
(0.838709652424, 0.61960786581, 0.61960786581),
(0.870967745781, 0.68235296011, 0.68235296011),
(0.903225779533, 0.768627464771, 0.768627464771),
(0.93548387289, 0.843137264252, 0.843137264252),
(0.967741906643, 0.921568632126, 0.921568632126),
(1.0, 1.0, 1.0)],
'green': [
(0.0, 0.0, 0.0),
(0.0322580635548, 0.0, 0.0),
(0.0645161271095, 0.0196078438312, 0.0196078438312),
(0.0967741906643, 0.0392156876624, 0.0392156876624),
(0.129032254219, 0.0980392172933, 0.0980392172933),
(0.161290317774, 0.156862750649, 0.156862750649),
(0.193548381329, 0.40000000596, 0.40000000596),
(0.225806444883, 0.505882382393, 0.505882382393),
(0.258064508438, 0.686274528503, 0.686274528503),
(0.290322571993, 0.745098054409, 0.745098054409),
(0.322580635548, 0.792156875134, 0.792156875134),
(0.354838699102, 0.882352948189, 0.882352948189),
(0.387096762657, 0.921568632126, 0.921568632126),
(0.419354826212, 0.921568632126, 0.921568632126),
(0.451612889767, 0.92549020052, 0.92549020052),
(0.483870953321, 0.960784316063, 0.960784316063),
(0.516129016876, 1.0, 1.0),
(0.548387110233, 0.960784316063, 0.960784316063),
(0.580645143986, 0.92549020052, 0.92549020052),
(0.612903237343, 0.843137264252, 0.843137264252),
(0.645161271095, 0.741176486015, 0.741176486015),
(0.677419364452, 0.627451002598, 0.627451002598),
(0.709677398205, 0.458823531866, 0.458823531866),
(0.741935491562, 0.313725501299, 0.313725501299),
(0.774193525314, 0.352941185236, 0.352941185236),
(0.806451618671, 0.486274510622, 0.486274510622),
(0.838709652424, 0.61960786581, 0.61960786581),
(0.870967745781, 0.701960802078, 0.701960802078),
(0.903225779533, 0.768627464771, 0.768627464771),
(0.93548387289, 0.843137264252, 0.843137264252),
(0.967741906643, 0.921568632126, 0.921568632126),
(1.0, 1.0, 1.0)],
'red': [
(0.0, 0.0392156876624, 0.0392156876624),
(0.0322580635548, 0.156862750649, 0.156862750649),
(0.0645161271095, 0.0784313753247, 0.0784313753247),
(0.0967741906643, 0.0, 0.0),
(0.129032254219, 0.0, 0.0),
(0.161290317774, 0.0, 0.0),
(0.193548381329, 0.101960785687, 0.101960785687),
(0.225806444883, 0.0509803928435, 0.0509803928435),
(0.258064508438, 0.0980392172933, 0.0980392172933),
(0.290322571993, 0.196078434587, 0.196078434587),
(0.322580635548, 0.266666680574, 0.266666680574),
(0.354838699102, 0.380392163992, 0.380392163992),
(0.387096762657, 0.415686279535, 0.415686279535),
(0.419354826212, 0.486274510622, 0.486274510622),
(0.451612889767, 0.541176497936, 0.541176497936),
(0.483870953321, 0.674509823322, 0.674509823322),
(0.516129016876, 0.803921580315, 0.803921580315),
(0.548387110233, 0.874509811401, 0.874509811401),
(0.580645143986, 0.941176474094, 0.941176474094),
(0.612903237343, 0.96862745285, 0.96862745285),
(0.645161271095, 1.0, 1.0),
(0.677419364452, 1.0, 1.0),
(0.709677398205, 0.956862747669, 0.956862747669),
(0.741935491562, 0.933333337307, 0.933333337307),
(0.774193525314, 1.0, 1.0),
(0.806451618671, 1.0, 1.0),
(0.838709652424, 1.0, 1.0),
(0.870967745781, 0.960784316063, 0.960784316063),
(0.903225779533, 1.0, 1.0),
(0.93548387289, 1.0, 1.0),
(0.967741906643, 1.0, 1.0),
(1.0, 1.0, 1.0)]}
Now imagine tweaking this map by hand, i.e. lower 0 value (~ 2/3 from whole
cmap in example) from orange to green-blue without ruining it totally
So I want to ask this question differently: Is there some tool (Inkscape,
CorelDraw, Photoshop, ... anything) that would let me use GUI with some
sliders so that I can try adjust matplotlib colormap?
On Sun, Nov 6, 2011 at 9:58 PM, klo uo <kl...@gm...> wrote:
> Like in Basemap examples:
> http://matplotlib.github.com/basemap/users/examples.html (topographic
> image in the middle of page) ground 0 has some yellow/orange color
> making seas and oceans coasts in that same, color instead light blue
> (as we'd all expect I guess)
>
> So how to shift this particular colormap (cm.GMT_haxby) up a bit, so
> that I get expected colors?
>
From: Alejandro W. <ale...@gm...> - 2011年11月11日 14:32:30
On Thu, Nov 10, 2011 at 11:04 PM, John Ladasky
<joh...@sb...> wrote:
> But when I started a Python shell, imported, and then printed
> matplotlib.__version__, I got 1.0.1.
>
> Must I explicitly uninstall the older revision somehow? I don't know
> how to do this.
>
Something similar happened to me a few days ago. I followed this instructions
http://matplotlib.sourceforge.net/faq/installing_faq.html#how-to-completely-remove-matplotlib
to completely remove matplotlib, and then I rebuilt the latest
version from source.
Alejandro.
From: Ludwig S. <lud...@gm...> - 2011年11月11日 08:59:27
Hi Russell,
The System Python 2.7.1 on 10.7 is also 64-bit (I checked the size of sys.maxint to confirm this). I have built matplotlib 1.1.0 on this with the standard Lion LLVM compiler (i686-apple-darwin11-llvm-gcc-4.2) and TkAgg works fine. Once you have pkg-config on your system (I use homebrew for this), matplotlib can be built without any further ado - no compiler bypasses, no files to edit. It can even be easy_installed directly from PyPI.
Just thinking out loud - would it make sense to base the dmg installer on System Python instead? My feeling is that the *average* user is best served in this way. There is very little difference between System Python 2.7.1 and Python.org Python 2.7.2, except that the former does not have compilation issues. Also, the System NumPy 1.5.1 is more than adequate for the average user and does not need to be replaced too. In this case, the average user can literally download the dmg and install it on a vanilla Lion system without any other dependencies. To me, this would represent the best default packaging of matplotlib on the Mac, and I would consider anything else a custom installation.
I've been using matplotlib and friends for nearly four years now on System Python (since Leopard) as a non-average user :-), and I've never felt the need to use a different Python. It certainly simplifies installation...
Regards,
Ludwig
From: Eric F. <ef...@ha...> - 2011年11月11日 06:18:22
On 11/10/2011 08:04 PM, John Ladasky wrote:
> Hello everyone,
>
> I've been struggling to get consistent animation results from Matplotlib
> 1.0.1. I am not entirely sure why I can get some programs to work, and
> others not. The back-and-forth between the pyplot/pylab state-machine
> approach and a more explicit object-oriented model gets me dizzy
> sometimes.
>
> I noticed that version 1.1.0 is taking an entirely new approach to
> animations, with the animation module. Rather than invest more energy
> in the old way of doing things, I decided to upgrade.
>
> I downloaded the source, and built it as described here:
>
> http://matplotlib.sourceforge.net/users/installing.html
>
> I did not see any error messages during setup or install.
>
> But when I started a Python shell, imported, and then printed
> matplotlib.__version__, I got 1.0.1.
>
> Must I explicitly uninstall the older revision somehow? I don't know
> how to do this.
>
> I suppose that I might have both versions installed, and that might be
> useful if I have code that runs on the older version but not the new.
>
> Alternately, is there a way to specify that 1.1.0 is now my default
> version?
>
> Thanks for any guidance and advice!
What platform are you using? How was 1.0.1 installed?
Eric
>
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save 700ドル by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: John L. <joh...@sb...> - 2011年11月11日 06:04:40
Hello everyone,
I've been struggling to get consistent animation results from Matplotlib
1.0.1. I am not entirely sure why I can get some programs to work, and
others not. The back-and-forth between the pyplot/pylab state-machine
approach and a more explicit object-oriented model gets me dizzy
sometimes.
I noticed that version 1.1.0 is taking an entirely new approach to
animations, with the animation module. Rather than invest more energy
in the old way of doing things, I decided to upgrade.
I downloaded the source, and built it as described here:
http://matplotlib.sourceforge.net/users/installing.html
I did not see any error messages during setup or install.
But when I started a Python shell, imported, and then printed
matplotlib.__version__, I got 1.0.1.
Must I explicitly uninstall the older revision somehow? I don't know
how to do this.
I suppose that I might have both versions installed, and that might be
useful if I have code that runs on the older version but not the new.
Alternately, is there a way to specify that 1.1.0 is now my default
version?
Thanks for any guidance and advice!
2011年11月11日 Michael Droettboom <md...@st...>:
> On 11/10/2011 05:16 PM, Friedrich Romstedt wrote:
>> Furthermore, Michael is right, while bisecting I didn't ``rm build/``
>> properly; I just did ``python2.6 setup.py clean``. Later on I did that
>> properly, after I noticed that the offending commit reported by bisect
>> actually runs cleanly. I then wrote a test script for ``git bisect
>> run`` that applies all those steps, so I couldn't keep forgetting it
>> any longer :-) Friedrich
> Running bisect in this way, did you arrive at a more conclusive
> determination about which commit may have introduced the problem?
No, I didn't, but I found it manually (kind-of), while trying to find
anchor points for git bisect:
If you use gitk on cb609d5415e, and scroll down to "Merge branch
'v0.99.x' into v1.0.x" (13894992d8), you'll see a couple of merges.
Here, up to the merge into v1.0.x, things work. In the v1.0.x branch,
everything down to the beginning of 2010 [sic] what I tested failed,
including the 1.0.0 release 668a769fb.
I was wrong in my conclusion in my first mail that it's the v0.99.x
branch, which introduces the bug, it's apparently the v1.0.x branch.
I was planning to check some early commit after some merges in 2009 on
the v1.0.x branch, after 1982fba643, and the first commit in 2010 on
the v1.0.x branch, bbcb85a663bbb. If one is good and one is bad I'd
have let it run bisect overnight.
1982fba643 (the first unmerged, see above) is not properly updated for
new libpng. The first out of 10/2009 does not work either, for same
reason. The first out of 11/2009 does not work too. The first of
12/2009 also not. The first in 01/2010 fails to compile too. First
of 02/2010: fails compiling. First of 03/2010: compiles, and fails on
the import level with Bus error.
So I'm screwed for today. I have to dig out my patch for that libpng
issue and incorporate it into the test script.
So far the bug arised < 03/2010. sic. sigh.
Friedrich
On 11/10/2011 05:16 PM, Friedrich Romstedt wrote:
> Furthermore, Michael is right, while bisecting I didn't ``rm build/`` 
> properly; I just did ``python2.6 setup.py clean``. Later on I did that 
> properly, after I noticed that the offending commit reported by bisect 
> actually runs cleanly. I then wrote a test script for ``git bisect 
> run`` that applies all those steps, so I couldn't keep forgetting it 
> any longer :-) Friedrich
Running bisect in this way, did you arrive at a more conclusive 
determination about which commit may have introduced the problem?
Mike
1 message has been excluded from this view by a project administrator.

Showing 25 results of 25

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 によって変換されたページ (->オリジナル) /