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
|
2
(13) |
3
(5) |
4
(5) |
5
(21) |
6
(10) |
7
(9) |
|
8
(4) |
9
(11) |
10
(9) |
11
(11) |
12
(25) |
13
(5) |
14
(2) |
|
15
(5) |
16
(8) |
17
(16) |
18
(11) |
19
(15) |
20
(5) |
21
(8) |
|
22
(4) |
23
(24) |
24
(9) |
25
(14) |
26
(5) |
27
(28) |
28
(2) |
|
29
(13) |
30
(14) |
31
(11) |
|
|
|
|
|
From: Benjamin R. <ben...@ou...> - 2012-01-09 16:05:16
|
2012/1/8 Zoltán Vörös <zv...@gm...> > colors = np.empty(X.shape, tuple) > for y in range(ylen): > for x in range(xlen): > colors[x, y] = (0, 0, 1, 1) > > surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, facecolors=colors, > linewidth=0.0, antialiased=True) > Is the issue that you have transparent lines between the faces? Set the "shade" kwarg to True and the "antialiased" kwarg to False. If the shading is not what you want, it has been a feature request to implement the smooth coloring that shading does, but without a lightsource. I have yet to do this, and there have been some attempts to get this right, but nothing finalized yet. Contributions would be welcomed! Ben Root |
|
From: Ryan M. <rm...@gm...> - 2012-01-09 14:58:44
|
On Mon, Jan 9, 2012 at 5:28 AM, <kei...@bt...> wrote: > I just installed matplotlib 1.1.0. When I try the animation examples from http://matplotlib.sourceforge.net/examples/animation/index.html, they just flash up a window for a fraction of a second, and then terminate with no message (animate_decay.py, strip_chart_demo.py, etc). Is this what they are supposed to do? The documentation at http://matplotlib.sourceforge.net/api/animation_api.html is very terse. When I include the line > > im_ani.save('im.mp4') > > in animate_basic_example.py, I get this crash: > > kbriggs@gold:~> python animate_basic_example.py > > Traceback (most recent call last): > File "animate_basic_example.py", line 32, in <module> > im_ani.save('im.mp4') > File "/usr/local/lib/python2.7/site-packages/matplotlib/animation.py", line 127, in save > self._make_movie(filename, fps, codec, frame_prefix) > File "/usr/local/lib/python2.7/site-packages/matplotlib/animation.py", line 164, in _make_movie > stdout=PIPE, stderr=PIPE) > File "/usr/local/lib/python2.7/subprocess.py", line 679, in __init__ > errread, errwrite) > File "/usr/local/lib/python2.7/subprocess.py", line 1228, in _execute_child > raise child_exception > OSError: [Errno 2] No such file or directory Saving generally requires ffmpeg. You could try installing that or commenting out the call to save(). Given that saving is half-baked at this point, a good maintainer of this code *cough*me*cough* would probably make a problem saving not completely crap out the script. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
|
From: <kei...@bt...> - 2012-01-09 11:41:25
|
I just installed matplotlib 1.1.0. When I try the animation examples from http://matplotlib.sourceforge.net/examples/animation/index.html, they just flash up a window for a fraction of a second, and then terminate with no message (animate_decay.py, strip_chart_demo.py, etc). Is this what they are supposed to do? The documentation at http://matplotlib.sourceforge.net/api/animation_api.html is very terse. When I include the line im_ani.save('im.mp4') in animate_basic_example.py, I get this crash: kbriggs@gold:~> python animate_basic_example.py Traceback (most recent call last): File "animate_basic_example.py", line 32, in <module> im_ani.save('im.mp4') File "/usr/local/lib/python2.7/site-packages/matplotlib/animation.py", line 127, in save self._make_movie(filename, fps, codec, frame_prefix) File "/usr/local/lib/python2.7/site-packages/matplotlib/animation.py", line 164, in _make_movie stdout=PIPE, stderr=PIPE) File "/usr/local/lib/python2.7/subprocess.py", line 679, in __init__ errread, errwrite) File "/usr/local/lib/python2.7/subprocess.py", line 1228, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory Keith |
|
From: Georg B. <g.b...@gm...> - 2012-01-09 09:59:07
|
On 01/05/2012 05:58 PM, Benjamin Root wrote: > > > On Thu, Jan 5, 2012 at 10:40 AM, Benjamin Root <ben...@ou... > <mailto:ben...@ou...>> wrote: > > > At the very least, it would help in compartmentallizing all the possible > drawing attributes that are common across all artists. Currently, I am > envisioning using a defaultdict object (which was introduced in python > 2.5) or subclassing from it. This might help in keeping compatibility > with existing code. Subclassing would allow for modifying __get__ and > __set__ to treat some elements like 'c' and 'color', 'lw' and > 'linewidth' and so on as the same. > > > Grrrr, in defaultdict(), the default_factory is called without arguments, so a > factory can't be made to produce a default value for a given key, unless I > resort to more hackary... FWIW, defaultdict() only uses the __missing__ dictionary hook, and that one is passed the key. It's easy to implement a similar class that calls the factory with a key argument. Georg |
|
From: Zoltán V. <zv...@gm...> - 2012-01-08 22:05:33
|
Hi All,
I wanted to make a surface plot with some phong on it. I can generate
the colour map without any problems, but the snag is that no matter what
I do, the resulting plot is always transparent. It there a way to set
the patch colour to a true solid colour?
Here is a piece of my code (without the phong)
<snip>
colors = np.empty(X.shape, tuple)
for y in range(ylen):
for x in range(xlen):
colors[x, y] = (0, 0, 1, 1)
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, facecolors=colors,
linewidth=0.0, antialiased=True)
</snip>
As far as I understand, this should generate a solid blue surface, but
this is not what happens. Any hints or solutions?
Cheers,
Zoltán
|
|
From: Ethan S. <es...@vt...> - 2012-01-08 16:56:01
|
On 1/8/2012 2:29 AM, Eric Firing wrote:
> On 01/07/2012 07:01 PM, Ethan Swint wrote:
>> Hi, list-
>>
>> This question has been asked before, but all of my search results don't
>> address my problem:
>> <code>
>> fig = figure(1, figsize=(3.25, 3))
>> plot([0,1,5,2,9])
>> title('title')
>> xlabel('xAxis')
>> ylabel('yAxis')
>> fig.savefig('test.png',dpi=600)
>> </code>
>> The resulting figure is 2040x1890 pixels, or 3.4"x3.15", and the xlabel
>> is cut off. Looking at the PNG file in an image editor, it appears that
>> the axes and ticklabels fit the desired size. I've tried taking the
>> difference from the output size and requested size and feeding that back
>> in (3.25 - (3.4-3.25) = 3.10, but matplotlib seems to add an arbitrary
>> buffer and it still doesn't come out to the desired size. How does one
>> make an overall figure that is the desired size?
> Ethan,
>
> There seem to be two questions here. First, when I run your code, I get
> a png file of the right size:
> test.png: PNG image data, 1950 x 1800, 8-bit/color RGBA, non-interlaced
>
> What version of mpl are you using? I don't recall that it ever had the
> property you are reporting, generating a larger figure than requested.
>
> The second question is about the xlabel getting cut off. This is
> happening because mpl is using default subplot parameters that leave
> plenty of space for tick labels and axis labels with the default figure
> size, but don't leave enough if the figure is much smaller, and leave
> too much if the figure is much bigger. The subplot parameters are
> expressed as fractions of the figure size, but the text does not scale
> automatically with the figure size. Therefore you have to either
> specify the Axes position manually to leave the right size margins, or
> use subplots_adjust. When a figure is displayed on the screen, there is
> a button on the toolbar that brings up a subplots_adjust widget; this
> can be used to find values appropriate for your figure size, which you
> can then supply to your script. In the standard set of mpl examples
> there are many instances of subplots_adjust, e.g.,
> http://matplotlib.sourceforge.net/examples/pylab_examples/subplots_adjust.html
Eric-
Thanks for your reply. I actually had the MPL version copied, but
somehow I forgot to paste it: matplotlib.__version__ is 1.0.1 on Python
2.7.2, Ipython v. 0.11, on Windoze 7 x64. Around 2AM I found that if I
called fig.set_size_inches(3.25,3) just before calling fig.savefig(), it
did produce the proper size image.
For your viewing pleasure, on my system I get:
<code>
In [228]: fig = figure(3, figsize=(3.15, 3.15))
In [229]: fig.savefig('test0.png',dpi=600)
In [230]: fig.get_size_inches()
Out[230]: array([ 3.3, 3.3])
<\code>
The output is indeed 3.3"x3.3" (1980x1980). I'll upgrade to MPL 1.1.0
and see if that helps the initial size problem.
As for subplots_adjust - I'll have to dig into that. Will I need to
make my figure with subplot(111) instead of figure()? Hmm - off to
experiment.
Thanks,
Ethan
|
|
From: Eric F. <ef...@ha...> - 2012-01-08 07:29:32
|
On 01/07/2012 07:01 PM, Ethan Swint wrote:
> Hi, list-
>
> This question has been asked before, but all of my search results don't
> address my problem:
> <code>
> fig = figure(1, figsize=(3.25, 3))
> plot([0,1,5,2,9])
> title('title')
> xlabel('xAxis')
> ylabel('yAxis')
> fig.savefig('test.png',dpi=600)
> </code>
> The resulting figure is 2040x1890 pixels, or 3.4"x3.15", and the xlabel
> is cut off. Looking at the PNG file in an image editor, it appears that
> the axes and ticklabels fit the desired size. I've tried taking the
> difference from the output size and requested size and feeding that back
> in (3.25 - (3.4-3.25) = 3.10, but matplotlib seems to add an arbitrary
> buffer and it still doesn't come out to the desired size. How does one
> make an overall figure that is the desired size?
Ethan,
There seem to be two questions here. First, when I run your code, I get
a png file of the right size:
test.png: PNG image data, 1950 x 1800, 8-bit/color RGBA, non-interlaced
What version of mpl are you using? I don't recall that it ever had the
property you are reporting, generating a larger figure than requested.
The second question is about the xlabel getting cut off. This is
happening because mpl is using default subplot parameters that leave
plenty of space for tick labels and axis labels with the default figure
size, but don't leave enough if the figure is much smaller, and leave
too much if the figure is much bigger. The subplot parameters are
expressed as fractions of the figure size, but the text does not scale
automatically with the figure size. Therefore you have to either
specify the Axes position manually to leave the right size margins, or
use subplots_adjust. When a figure is displayed on the screen, there is
a button on the toolbar that brings up a subplots_adjust widget; this
can be used to find values appropriate for your figure size, which you
can then supply to your script. In the standard set of mpl examples
there are many instances of subplots_adjust, e.g.,
http://matplotlib.sourceforge.net/examples/pylab_examples/subplots_adjust.html
Eric
>
> Thanks,
> Ethan
>
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Ethan S. <es...@vt...> - 2012-01-08 05:01:53
|
Hi, list-
This question has been asked before, but all of my search results don't
address my problem:
<code>
fig = figure(1, figsize=(3.25, 3))
plot([0,1,5,2,9])
title('title')
xlabel('xAxis')
ylabel('yAxis')
fig.savefig('test.png',dpi=600)
</code>
The resulting figure is 2040x1890 pixels, or 3.4"x3.15", and the xlabel
is cut off. Looking at the PNG file in an image editor, it appears that
the axes and ticklabels fit the desired size. I've tried taking the
difference from the output size and requested size and feeding that back
in (3.25 - (3.4-3.25) = 3.10, but matplotlib seems to add an arbitrary
buffer and it still doesn't come out to the desired size. How does one
make an overall figure that is the desired size?
Thanks,
Ethan
|
|
From: Benjamin R. <ben...@ou...> - 2012-01-07 17:18:09
|
On Saturday, January 7, 2012, Jae-Joon Lee <lee...@gm...> wrote: > Please post a complete (but simple) example that we can easily test. > Doing the *subplot_adjust* will mess up the location of colorbars, but > I believe that colorbars should be still there. > If you're using v1.1 and later, see if using the "use_gridspec" > parameter works. For example, > > colorbar(use_gridspec=True) > > Regards, > > -JJ > > Personally, I just simply use the AxesGrid1 toolkit which automatically allocates space for colorbars if I tell it to. Very easy to use. Ben Root |
|
From: Benjamin R. <ben...@ou...> - 2012-01-07 17:13:40
|
On Saturday, January 7, 2012, Mingkui Li <ken...@gm...> wrote: > Yes, I think this is the origin of the Error. > Thank you all! > BTW, why the email title of all other people posts begin with '[matplotlib-user]'? does this should be added by hand every time when I post a topic? > No, don't do that. The added part of the title is done automatically by the list server. However, on this list, we post replies on the bottom. Ben Root |
|
From: Jae-Joon L. <lee...@gm...> - 2012-01-07 14:57:35
|
On Fri, Jan 6, 2012 at 4:56 AM, Skipper Seabold <jss...@gm...> wrote:
> but when I call show, it seems the width of
> the box is reset.
Yes. Because the location of the texts are backend-dependent, the
location of the xbox surrounding the text are recalculated during the
drawing time. I don't think there is no easy workaround unfortunately.
If you are experienced in matplotlib, you may try is to rewrite the
get_path method of the bbox. The example code below, while a bit
complicated, tries to make the the bbox align with the axes.
ax.title.set_ha("left")
bbox_get_path = bbox.get_path
def my_get_path():
pad = bbox.get_boxstyle().pad*bbox.get_mutation_scale()
x0, y0 = bbox.get_transform().transform_point((0,0))
xx = ax.bbox.x0 - x0
bbox.set_x(xx+pad)
bbox.set_width(ax.bbox.width-2*pad)
return bbox_get_path()
bbox.get_path = my_get_path
regards,
-JJ
|
|
From: Jae-Joon L. <lee...@gm...> - 2012-01-07 13:52:29
|
Please post a complete (but simple) example that we can easily test. Doing the *subplot_adjust* will mess up the location of colorbars, but I believe that colorbars should be still there. If you're using v1.1 and later, see if using the "use_gridspec" parameter works. For example, colorbar(use_gridspec=True) Regards, -JJ On Sat, Jan 7, 2012 at 8:34 PM, davcra <dcd...@gm...> wrote: > > Hi, I need to add a colorbar to each plot in a subplot but cant seem to get > it to work. My code is as follows, > > # Plot time series of slowness, baz, abs.power and rel.power > labels = 'rel.power abs.power baz slow'.split() > > fig = plt.figure() > for i, lab in enumerate(labels): > ax = fig.add_subplot(4, 1, i + 1) > ax.scatter(out[:, 0], out[:, i + 1], c=out[:, 1], alpha=0.6, > edgecolors='none') > ax.set_ylabel(lab) > colorbar() > fig.autofmt_xdate() > fig.subplots_adjust(top=0.95, right=0.95, bottom=0.2, hspace=0.25) > plt.show() > > Dont get any error but the colorbar is missing from the plot, anyone know > how it is done???? > -- > View this message in context: http://old.nabble.com/Colorbar-on-each-subplot-tp33098035p33098035.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: davcra <dcd...@gm...> - 2012-01-07 11:34:40
|
Hi, I need to add a colorbar to each plot in a subplot but cant seem to get
it to work. My code is as follows,
# Plot time series of slowness, baz, abs.power and rel.power
labels = 'rel.power abs.power baz slow'.split()
fig = plt.figure()
for i, lab in enumerate(labels):
ax = fig.add_subplot(4, 1, i + 1)
ax.scatter(out[:, 0], out[:, i + 1], c=out[:, 1], alpha=0.6,
edgecolors='none')
ax.set_ylabel(lab)
colorbar()
fig.autofmt_xdate()
fig.subplots_adjust(top=0.95, right=0.95, bottom=0.2, hspace=0.25)
plt.show()
Dont get any error but the colorbar is missing from the plot, anyone know
how it is done????
--
View this message in context: http://old.nabble.com/Colorbar-on-each-subplot-tp33098035p33098035.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: davcra <dcd...@gm...> - 2012-01-07 10:51:03
|
Hi, I need to add a colorbar to each plot in a subplot but cant seem to get
it to work. My code is as follows,
# Plot time series of slowness, baz, abs.power and rel.power
labels = 'rel.power abs.power baz slow'.split()
fig = plt.figure()
for i, lab in enumerate(labels):
ax = fig.add_subplot(4, 1, i + 1)
ax.scatter(out[:, 0], out[:, i + 1], c=out[:, 1], alpha=0.6,
edgecolors='none')
ax.set_ylabel(lab)
colorbar()
fig.autofmt_xdate()
fig.subplots_adjust(top=0.95, right=0.95, bottom=0.2, hspace=0.25)
plt.show()
Dont get any error but the colorbar is missing from the plot, anyone know
how it is done????
--
View this message in context: http://old.nabble.com/How-to-use-colorbar-in-subplot-tp33097878p33097878.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: Mingkui Li <ken...@gm...> - 2012-01-07 07:04:06
|
Yes, I think this is the origin of the Error.
Thank you all!
BTW, why the email title of all other people posts begin with
'[matplotlib-user]'? does this should be added by hand every time when I
post a topic?
On Sat, Jan 7, 2012 at 11:44 AM, Michiel de Hoon <mjl...@ya...>wrote:
> The problem seems to originate from this line in lib/matplotlib/sankey.py:
>
> patch = PathPatch(Path(vertices, codes),
> fc=kwargs.pop('fc', kwargs.pop('facecolor',
> '#bfd1d4')), # Custom defaults
> lw=kwargs.pop('lw', kwargs.pop('linewidth',
> '0.5')),
> **kwargs)
>
> Note that the linewidth is set to the string '0.5' rather than the float
> 0.5. gc.set_linewidth is then called with the string '0.5' as the argument,
> which triggers the error. If I replace '0.5' by 0.5, the example runs fine
> with the MacOSX backend.
>
> Is there a reason why this needs to be a string here? I would think that
> in general gc.set_linewidth should only accept floats and ints.
>
> -Michiel.
>
>
>
>
> --- On *Fri, 1/6/12, Mingkui Li <ken...@gm...>* wrote:
>
>
> From: Mingkui Li <ken...@gm...>
> Subject: [Matplotlib-users] matplotlib 1.1 "TypeError: a float is
> required" problem
> To: mat...@li...
> Date: Friday, January 6, 2012, 10:54 AM
>
>
> I just updated matplotlib to 1.1 and want try the new features Sankey
> Diagrams
>
> and
> Animation
>
> but when I try the api example code: sankey_demo_basics.py
>
> I got the error messages as below:
>
> ==============================================================================
> Traceback (most recent call last):
> File
> "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py",
> line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File
> "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/figure.py",
> line 884, in draw
> func(*args)
> File
> "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py",
> line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File
> "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/axes.py",
> line 1983, in draw
> a.draw(renderer)
> File
> "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py",
> line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File
> "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py",
> line 385, in draw
> gc.set_linewidth(lw)
> TypeError: a float is required
> Traceback (most recent call last):
> File
> "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py",
> line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File
> "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/figure.py",
> line 884, in draw
> func(*args)
> File
> "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py",
> line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File
> "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/axes.py",
> line 1983, in draw
> a.draw(renderer)
> File
> "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py",
> line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File
> "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py",
> line 385, in draw
> gc.set_linewidth(lw)
> TypeError: a float is required
>
> ==================================================================================
>
> Then I looked into the
> file /Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py
> at the line 384 the code is: gc.set_linewidth(lw)
> I added "lw = np.float(lw)" before "gc.set_linewidth(lw)", then the
> example code runs successfully.
>
> Any help?
>
> Thanks for any reply.
>
> --
> Mingkui Li
>
>
> -----Inline Attachment Follows-----
>
>
>
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
>
> -----Inline Attachment Follows-----
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...<http://mc/compose?to=...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
Mingkui Li
|
|
From: Michiel de H. <mjl...@ya...> - 2012-01-07 03:44:54
|
The problem seems to originate from this line in lib/matplotlib/sankey.py:
patch = PathPatch(Path(vertices, codes),
fc=kwargs.pop('fc', kwargs.pop('facecolor',
'#bfd1d4')), # Custom defaults
lw=kwargs.pop('lw', kwargs.pop('linewidth',
'0.5')),
**kwargs)
Note that the linewidth is set to the string '0.5' rather than the float 0.5. gc.set_linewidth is then called with the string '0.5' as the argument, which triggers the error. If I replace '0.5' by 0.5, the example runs fine with the MacOSX backend.
Is there a reason why this needs to be a string here? I would think that in general gc.set_linewidth should only accept floats and ints.
-Michiel.
--- On Fri, 1/6/12, Mingkui Li <ken...@gm...> wrote:
From: Mingkui Li <ken...@gm...>
Subject: [Matplotlib-users] matplotlib 1.1 "TypeError: a float is required" problem
To: mat...@li...
Date: Friday, January 6, 2012, 10:54 AM
I just updated matplotlib to 1.1 and want try the new features
Sankey Diagrams
and
Animation
but when I try the api example code: sankey_demo_basics.py
I got the error messages as below:==============================================================================Traceback (most recent call last): File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs) File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/figure.py", line 884, in draw func(*args)
File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/axes.py", line 1983, in draw
a.draw(renderer) File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs)
File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py", line 385, in draw gc.set_linewidth(lw)TypeError: a float is required
Traceback (most recent call last): File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs)
File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/figure.py", line 884, in draw func(*args) File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs) File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/axes.py", line 1983, in draw a.draw(renderer)
File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py", line 385, in draw
gc.set_linewidth(lw)TypeError: a float is required==================================================================================
Then I looked into the file /Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py
at the line 384 the code is: gc.set_linewidth(lw)I added "lw = np.float(lw)" before "gc.set_linewidth(lw)", then the example code runs successfully.
Any help?
Thanks for any reply.
--
Mingkui Li
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
-----Inline Attachment Follows-----
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Gökhan S. <gok...@gm...> - 2012-01-07 00:14:20
|
Hello group, I am trying to align contour labels on my plot. Using the latest git clone I was able to position the labels somewhat nicer than the default positioning. (Following from https://github.com/matplotlib/matplotlib/issues/613 ) However, it requires manual specification of right data coords to create this plot and it is not easy to align them properly. Is there a mechanism to position and align labels on a specified line? See the linked image for better demonstration. http://imageshack.us/photo/my-images/210/cimage.png/ Thanks -- Gökhan |
|
From: David P. <dpe...@wi...> - 2012-01-06 22:57:35
|
When I try to turn on the grid for just one axis, seemingly in perfect accordance with the documentation at http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.grid it seems like there is a problem. My commands are pasted below. Am I doing this wrong? I am doing the best I can to follow the documentation exactly. Thanks for any help! import matplotlib matplotlib.use('MacOSX') import matplotlib.pyplot as plt fig=plt.figure() ax=fig.add_subplot(111) ax.plot([1,2,3]) ax.set_xlabel('Hi there') ax.grid(True, axis='x') bombayduck:~$ python Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib >>> matplotlib.use('MacOSX') >>> import matplotlib.pyplot as plt >>> fig=plt.figure() >>> ax=fig.add_subplot(111) >>> ax.plot([1,2,3]) [<matplotlib.lines.Line2D object at 0x1a27e30>] >>> ax.set_xlabel('Hi there') <matplotlib.text.Text object at 0x1a58030> >>> ax.grid(True, axis='x') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axes.py", line 1823, in grid self.xaxis.grid(b, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axis.py", line 965, in grid if len(kwargs): artist.setp(tick.gridline,**kwargs) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/artist.py", line 1169, in setp func = getattr(o,funcName) AttributeError: 'Line2D' object has no attribute 'set_axis' -dave---------------------------------------------------------------------- A neuroscientist is at the video arcade, when someone makes him a $1000 bet on Pac-Man. He smiles, gets out his screwdriver and takes apart the Pac-Man game. Everyone says "What are you doing?" The neuroscientist says "Well, since we all know that Pac-Man is based on electric signals traveling through these circuits, obviously I can understand it better than the other guy by going straight to the source!" |
|
From: Michael D. <md...@st...> - 2012-01-06 19:40:36
|
I've filed a bug for this here: https://github.com/matplotlib/matplotlib/issues/662 Mike On 01/06/2012 11:55 AM, David Hoese wrote: > Hi Ken, > > You're getting that error because you probably don't have Qt4 > installed on your Mac (I do). I'm not sure what backends come with > matplotlib and will work for you (maybe someone here knows). You can > use any of the following: > GTK GTKAgg GTKCairo CocoaAgg FltkAgg > MacOSX QtAgg Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG Template > Like Qt4, some of those may need to be installed. I also have Gtk > installed (never used it before) and "GTKAgg" works for me, but not > "GTK". It's also important to know that not all of those backends are > interactive (they don't all show a window) and the figure must be > saved to a file. > > Also make sure that the 2 lines I provided need to be BEFORE any other > matplotlib/pyplot imports. Hope you find something that works for > you, at least until the macosx bug is fixed. I'm not an expert, sorry. > > -Dave > > On 1/6/12 10:35 AM, Mingkui Li wrote: >> Hi, Dave, >> >> I tried the two lines of code you posted, but when I ran the example >> I mentioned above I got such error: >> >> ImportError: No module named sip >> >> Seems I can't import any other libs from matplotlib after >> "matplotlib.use("Qt4Agg")" >> >> I'm kind of a newbie, sorry. >> >> Ken >> >> >> On Sat, Jan 7, 2012 at 12:22 AM, David Hoese <dh...@gm... >> <mailto:dh...@gm...>> wrote: >> >> I experienced the same problem on the macosx backend, switched to >> Qt4Agg >> and no problems. >> >> import matplotlib >> matplotlib.use("Qt4Agg") >> >> -Dave >> >> On 1/6/12 10:08 AM, md...@st... <mailto:md...@st...> wrote: >> > I suspect this bug is specific to the macosx backend. Can you >> switch to >> > another backend and confirm it doesn't happen there? (I can't >> reproduce >> > it on Linux). >> > >> > Mike >> >> >> ------------------------------------------------------------------------------ >> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a >> complex >> infrastructure or vast IT resources to deliver seamless, secure >> access to >> virtual desktops. With this all-in-one solution, easily deploy >> virtual >> desktops for less than the cost of PCs and save 60% on VDI >> infrastructure >> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> <mailto:Mat...@li...> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> >> >> -- >> Mingkui Li >> > > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Benjamin R. <ben...@ou...> - 2012-01-06 17:40:11
|
On Thu, Jan 5, 2012 at 3:18 PM, Ryan May <rm...@gm...> wrote: > On Thu, Jan 5, 2012 at 2:59 PM, Daniel Hyams <dh...@gm...> wrote: > > Right, __slots__ is definitely not a good idea to use except in very > > specific situations. I would strongly recommend against its usage here. > > > > http://groups.google.com/group/comp.lang.python/msg/0f2e859b9c002b28 > > I see that now. I had seen __slots__ used in a namedtuple example (in > the Python docs) and assumed it was a good idea. The same idea could > be achieved by using an internal _fields list and overriding > __getattr__ if the fixed list of attributes was deemed a useful > feature. > > Ryan > > > > > > > > > On Thu, Jan 5, 2012 at 3:50 PM, Eric Firing <ef...@ha...> wrote: > >> > >> On 01/05/2012 07:34 AM, Ryan May wrote: > >> > On Thu, Jan 5, 2012 at 10:58 AM, Benjamin Root<ben...@ou...> > wrote: > >> >> > >> >> > >> >> On Thu, Jan 5, 2012 at 10:40 AM, Benjamin Root<ben...@ou...> > wrote: > >> >>> > >> >>> > >> >>>> At the very least, it would help in compartmentallizing all the > >> >>>> possible > >> >>>> drawing attributes that are common across all artists. Currently, > I > >> >>>> am > >> >>>> envisioning using a defaultdict object (which was introduced in > >> >>>> python 2.5) > >> >>>> or subclassing from it. This might help in keeping compatibility > >> >>>> with > >> >>>> existing code. Subclassing would allow for modifying __get__ and > >> >>>> __set__ to > >> >>>> treat some elements like 'c' and 'color', 'lw' and 'linewidth' and > so > >> >>>> on as > >> >>>> the same. > >> >> > >> >> > >> >> Grrrr, in defaultdict(), the default_factory is called without > >> >> arguments, so > >> >> a factory can't be made to produce a default value for a given key, > >> >> unless I > >> >> resort to more hackary... > >> > > >> > Might be better to explicitly use properties for this rather than > >> > overriding dict: > >> > > >> > class Style(object): > >> > __slots__ = ('_lw') > >> > > >> > def __init__(self, lw=None): > >> > self.lw = lw > >> > > >> > def _set_linewidth(self, lw): > >> > self._lw = lw > >> > > >> > def _get_linewidth(self): > >> > return self._lw > >> > > >> > lw = property(_get_linewidth, _set_linewidth) > >> > linewidth = property(_get_linewidth, _set_linewidth) > >> > > >> > Declaring slots allows you to keep the available attributes to those > >> > explicity listed. This way, you can't set a random (misspelled?) > >> > attribute and wonder for hours why style.edgcolor = 'blue' doesn't > >> > work. > >> > >> This seems useful, and may be OK for this application; but a little > >> googling indicates that it is not really what __slots__ was intended > >> for, it is at best controversial, and it should be used very sparingly > >> and carefully. > >> > >> Eric > >> > >> > > >> > Ryan > >> > > >> > >> > Some thoughts I have had while trying to tackle this problem: 1) Major difficulty is that different plotting functions currently have different default values for various parameters. For example, spy() uses a square marker by default. Furthermore, there are differences in how plotting functions determine default-ness. 1.1 - call signature uses **kwarg Therefore, if something like 'c' is in kwarg, then it gets popped and used. If not, then sometimes a None is used which then means some sort of default elsewhere, or a value from a cycle somewhere is extracted. 1.2 - call signature uses prop=None idiom Therefore, it is impossible to know if the user explicitly wanted the default property value or did not pass anything in. 1.3 - call signature explicitly sets a default (i.e., fmt="b-") in call signature This prevents being able to extract a default value from a rcparam unless the user explicitly passes None. Therefore, it is difficult to have common style across all plots with a common/similar function calls. Sometimes, you explicitly pass None, sometimes you don't. 2) Plot property information being mixed in with the core process of creating plot elements. This makes the process of making sure that all desired properties are applied in a uniform and consistent manner. If each function could break its job into two basic parts: create plot elements for each dataset, apply style properties for each dataset plotted. In other words, for creating a bar chart, the process should first create Rectangle patches that places them at the correct locations and sized correctly (information that is based entirely on the dataset), but they would have no color, linewidth, hatch, etc. information yet. Then, styles are applied to each before returning them to the user. 3) rcparam naming. I wanted to name things like "cycle.color" and "cycle.marker", however, we currently have "axes.color_cycle". While I am fine with continuing this naming convention, do we want to codify a set of naming rules for future additions, or can they continue to be named anyway we wish? No matter how I look at this problem, we are looking at significant behavioral changes and output results. This will likely have to be an ongoing project and should probably be slated for a major version number change (i.e., v2.0.0). One particular feature I am tinkering on is a subclassed dict() that performs automatic translations of various property names (i.e., style['c'] and style['color'] are both the same element) and also performs fallbacks (i.e., if style['ec'] hasn't been set yet, then retrieve style['c']). This object might then be the basis of holding the core appearance information that is applied to the artist elements. Using it, we can codify various behaviors with respect to default values, rcparams and any other idiomatic things we have been doing. For my own purposes, I am essentially continuing the current pattern for a few more properties and trying to apply them to a few more functions. However, because it breaks many things while continuing bad coding styles, I doubt it should be marged into the official repos. Cheers! Ben Root |
|
From: David H. <dh...@gm...> - 2012-01-06 16:55:18
|
Hi Ken,
You're getting that error because you probably don't have Qt4 installed
on your Mac (I do). I'm not sure what backends come with matplotlib and
will work for you (maybe someone here knows). You can use any of the
following:
GTK GTKAgg GTKCairo CocoaAgg FltkAgg
MacOSX QtAgg Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG Template
Like Qt4, some of those may need to be installed. I also have Gtk
installed (never used it before) and "GTKAgg" works for me, but not
"GTK". It's also important to know that not all of those backends are
interactive (they don't all show a window) and the figure must be saved
to a file.
Also make sure that the 2 lines I provided need to be BEFORE any other
matplotlib/pyplot imports. Hope you find something that works for you,
at least until the macosx bug is fixed. I'm not an expert, sorry.
-Dave
On 1/6/12 10:35 AM, Mingkui Li wrote:
> Hi, Dave,
>
> I tried the two lines of code you posted, but when I ran the example I
> mentioned above I got such error:
>
> ImportError: No module named sip
>
> Seems I can't import any other libs from matplotlib after
> "matplotlib.use("Qt4Agg")"
>
> I'm kind of a newbie, sorry.
>
> Ken
>
>
> On Sat, Jan 7, 2012 at 12:22 AM, David Hoese <dh...@gm...
> <mailto:dh...@gm...>> wrote:
>
> I experienced the same problem on the macosx backend, switched to
> Qt4Agg
> and no problems.
>
> import matplotlib
> matplotlib.use("Qt4Agg")
>
> -Dave
>
> On 1/6/12 10:08 AM, md...@st... <mailto:md...@st...> wrote:
> > I suspect this bug is specific to the macosx backend. Can you
> switch to
> > another backend and confirm it doesn't happen there? (I can't
> reproduce
> > it on Linux).
> >
> > Mike
>
>
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a
> complex
> infrastructure or vast IT resources to deliver seamless, secure
> access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI
> infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
>
> --
> Mingkui Li
>
|
|
From: Mingkui Li <ken...@gm...> - 2012-01-06 16:35:10
|
Hi, Dave,
I tried the two lines of code you posted, but when I ran the example I
mentioned above I got such error:
ImportError: No module named sip
Seems I can't import any other libs from matplotlib after
"matplotlib.use("Qt4Agg")"
I'm kind of a newbie, sorry.
Ken
On Sat, Jan 7, 2012 at 12:22 AM, David Hoese <dh...@gm...> wrote:
> I experienced the same problem on the macosx backend, switched to Qt4Agg
> and no problems.
>
> import matplotlib
> matplotlib.use("Qt4Agg")
>
> -Dave
>
> On 1/6/12 10:08 AM, md...@st... wrote:
> > I suspect this bug is specific to the macosx backend. Can you switch to
> > another backend and confirm it doesn't happen there? (I can't reproduce
> > it on Linux).
> >
> > Mike
>
>
>
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Mingkui Li
|
|
From: Mingkui Li <ken...@gm...> - 2012-01-06 16:24:33
|
Thank you, Mike. I'll try the Linux version to find out. On Sat, Jan 7, 2012 at 12:06 AM, Michael Droettboom <md...@st...> wrote: > I suspect this bug is specific to the macosx backend. Can you switch to > another backend and confirm it doesn't happen there? (I can't reproduce it > on Linux). > > Mike > > > On 01/06/2012 10:54 AM, Mingkui Li wrote: > > I just updated matplotlib to 1.1 and want try the new features Sankey > Diagrams > > and > Animation > > but when I try the api example code: sankey_demo_basics.py > > I got the error messages as below: > > ============================================================================== > Traceback (most recent call last): > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/figure.py", > line 884, in draw > func(*args) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/axes.py", > line 1983, in draw > a.draw(renderer) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py", > line 385, in draw > gc.set_linewidth(lw) > TypeError: a float is required > Traceback (most recent call last): > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/figure.py", > line 884, in draw > func(*args) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/axes.py", > line 1983, in draw > a.draw(renderer) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py", > line 385, in draw > gc.set_linewidth(lw) > TypeError: a float is required > > ================================================================================== > > Then I looked into the > file /Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py > at the line 384 the code is: gc.set_linewidth(lw) > I added "lw = np.float(lw)" before "gc.set_linewidth(lw)", then the > example code runs successfully. > > Any help? > > Thanks for any reply. > > -- > Mingkui Li > > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > > > > _______________________________________________ > Matplotlib-users mailing lis...@li...://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Mingkui Li |
|
From: David H. <dh...@gm...> - 2012-01-06 16:22:56
|
I experienced the same problem on the macosx backend, switched to Qt4Agg
and no problems.
import matplotlib
matplotlib.use("Qt4Agg")
-Dave
On 1/6/12 10:08 AM, md...@st... wrote:
> I suspect this bug is specific to the macosx backend. Can you switch to
> another backend and confirm it doesn't happen there? (I can't reproduce
> it on Linux).
>
> Mike
|
|
From: Michael D. <md...@st...> - 2012-01-06 16:08:14
|
I suspect this bug is specific to the macosx backend. Can you switch to another backend and confirm it doesn't happen there? (I can't reproduce it on Linux). Mike On 01/06/2012 10:54 AM, Mingkui Li wrote: > I just updated matplotlib to 1.1 and want try the new features > > > Sankey Diagrams > > > and > > > Animation > > > but when I try the api example code: sankey_demo_basics.py > > I got the error messages as below: > ============================================================================== > Traceback (most recent call last): > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/figure.py", > line 884, in draw > func(*args) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/axes.py", > line 1983, in draw > a.draw(renderer) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py", > line 385, in draw > gc.set_linewidth(lw) > TypeError: a float is required > Traceback (most recent call last): > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/figure.py", > line 884, in draw > func(*args) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/axes.py", > line 1983, in draw > a.draw(renderer) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File > "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py", > line 385, in draw > gc.set_linewidth(lw) > TypeError: a float is required > ================================================================================== > > Then I looked into the > file /Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py > at the line 384 the code is: gc.set_linewidth(lw) > I added "lw = np.float(lw)" before "gc.set_linewidth(lw)", then the > example code runs successfully. > > Any help? > > Thanks for any reply. > > -- > Mingkui Li > > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |