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




Showing 9 results of 9

From: Alex C. <ac...@ac...> - 2012年07月28日 23:15:14
Hi matplotlib folks,
I am reaching out to various Python-related programming communities in 
order to offer my help packaging your software.
If you have ever struggled with packaging and releasing Python software 
(e.g. to PyPI), please check out my new service:
- http://pythonpackages.com
The basic idea is to automate packaging by checking out code, testing, 
and uploading (e.g. to PyPI) all through the web, as explained in this 
introduction:
- http://docs.pythonpackages.com/en/latest/introduction.html
Also, I will be available to answer your Python packaging questions most 
days/nights in #pythonpackages on irc.freenode.net. Hope to meet/talk 
with all of you soon.
Alex
-- 
Alex Clark · http://pythonpackages.com/ONE_CLICK
From: elmar w. <el...@ne...> - 2012年07月28日 20:25:38
Am 28.07.2012 21:46, schrieb Christoph Gohlke:
> On 7/28/2012 12:29 PM, elmar werling wrote:
>> Hi,
>>
>> just installed matplotlib by doing
>>
>> git clone https://github.com/matplotlib/matplotlib
>> cd matplotlib
>> python3 setup.py build
>> sudo python3 setup.py install
>>
>> When I import matplotlib.pyplot I get the following error message.
>>
>> Any help is wellcome
>> Elmar
>>
>>
>>
>> Python 3.2.1 (default, Jul 18 2011, 16:24:40) [GCC] on linux2
>> Type "copyright", "credits" or "license()" for more information.
>> >>> import numpy
>> >>> import matplotlib
>> >>> numpy.__version__
>> '1.6.2'
>> >>> matplotlib.__version__
>> '1.2.x'
>> >>> import matplotlib.pyplot
>> Traceback (most recent call last):
>> File "<pyshell#4>", line 1, in <module>
>> import matplotlib.pyplot
>> File "/usr/local/lib/python3.2/site-packages/matplotlib/pyplot.py",
>> line 26, in <module>
>> from matplotlib.figure import Figure, figaspect
>> File "/usr/local/lib/python3.2/site-packages/matplotlib/figure.py",
>> line 19, in <module>
>> from .axes import Axes, SubplotBase, subplot_class_factory
>> File "/usr/local/lib/python3.2/site-packages/matplotlib/axes.py",
>> line 21, in <module>
>> import matplotlib.dates as mdates
>> File "/usr/local/lib/python3.2/site-packages/matplotlib/dates.py",
>> line 122, in <module>
>> from dateutil.rrule import rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, \
>> File "/usr/local/lib/python3.2/site-packages/dateutil/rrule.py", line 55
>> raise ValueError, "Can't create weekday with n == 0"
>> ^
>> SyntaxError: invalid syntax
>> >>>
>>
>>
>>
>
> Install python-dateutil 2.1 <http://labix.org/python-dateutil/>. Do not
> use not dateutil 1.5 or the version included with matplotlib.
>
> See also <https://github.com/matplotlib/matplotlib/issues/983>
>
> Christoph
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
thank you,
will test it tommorow, first i have to install setuptools
From: Christoph G. <cg...@uc...> - 2012年07月28日 19:46:53
On 7/28/2012 12:29 PM, elmar werling wrote:
> Hi,
>
> just installed matplotlib by doing
>
> git clone https://github.com/matplotlib/matplotlib
> cd matplotlib
> python3 setup.py build
> sudo python3 setup.py install
>
> When I import matplotlib.pyplot I get the following error message.
>
> Any help is wellcome
> Elmar
>
>
>
> Python 3.2.1 (default, Jul 18 2011, 16:24:40) [GCC] on linux2
> Type "copyright", "credits" or "license()" for more information.
> >>> import numpy
> >>> import matplotlib
> >>> numpy.__version__
> '1.6.2'
> >>> matplotlib.__version__
> '1.2.x'
> >>> import matplotlib.pyplot
> Traceback (most recent call last):
> File "<pyshell#4>", line 1, in <module>
> import matplotlib.pyplot
> File "/usr/local/lib/python3.2/site-packages/matplotlib/pyplot.py",
> line 26, in <module>
> from matplotlib.figure import Figure, figaspect
> File "/usr/local/lib/python3.2/site-packages/matplotlib/figure.py",
> line 19, in <module>
> from .axes import Axes, SubplotBase, subplot_class_factory
> File "/usr/local/lib/python3.2/site-packages/matplotlib/axes.py",
> line 21, in <module>
> import matplotlib.dates as mdates
> File "/usr/local/lib/python3.2/site-packages/matplotlib/dates.py",
> line 122, in <module>
> from dateutil.rrule import rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, \
> File "/usr/local/lib/python3.2/site-packages/dateutil/rrule.py", line 55
> raise ValueError, "Can't create weekday with n == 0"
> ^
> SyntaxError: invalid syntax
> >>>
>
>
>
Install python-dateutil 2.1 <http://labix.org/python-dateutil/>. Do not 
use not dateutil 1.5 or the version included with matplotlib.
See also <https://github.com/matplotlib/matplotlib/issues/983>
Christoph
From: elmar w. <el...@ne...> - 2012年07月28日 19:29:59
Hi,
just installed matplotlib by doing
git clone https://github.com/matplotlib/matplotlib
cd matplotlib
python3 setup.py build
sudo python3 setup.py install
When I import matplotlib.pyplot I get the following error message.
Any help is wellcome
Elmar
Python 3.2.1 (default, Jul 18 2011, 16:24:40) [GCC] on linux2
Type "copyright", "credits" or "license()" for more information.
 >>> import numpy
 >>> import matplotlib
 >>> numpy.__version__
'1.6.2'
 >>> matplotlib.__version__
'1.2.x'
 >>> import matplotlib.pyplot
Traceback (most recent call last):
 File "<pyshell#4>", line 1, in <module>
 import matplotlib.pyplot
 File "/usr/local/lib/python3.2/site-packages/matplotlib/pyplot.py", 
line 26, in <module>
 from matplotlib.figure import Figure, figaspect
 File "/usr/local/lib/python3.2/site-packages/matplotlib/figure.py", 
line 19, in <module>
 from .axes import Axes, SubplotBase, subplot_class_factory
 File "/usr/local/lib/python3.2/site-packages/matplotlib/axes.py", 
line 21, in <module>
 import matplotlib.dates as mdates
 File "/usr/local/lib/python3.2/site-packages/matplotlib/dates.py", 
line 122, in <module>
 from dateutil.rrule import rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, \
 File "/usr/local/lib/python3.2/site-packages/dateutil/rrule.py", line 55
 raise ValueError, "Can't create weekday with n == 0"
 ^
SyntaxError: invalid syntax
 >>>
From: Benjamin R. <ben...@ou...> - 2012年07月28日 04:16:45
On Friday, July 27, 2012, JonBL wrote:
>
> I'm unsure about the role of numpy method arange in Matplotlib plots. All
> Matplotlib examples I have seen call numpy's method arange, and pass the
> result as the first arg to Matplotlib's plot method.
>
> But the following works as expected:
>
> --- quote ---
> import matplotlib.pyplot as plt
> import numpy as np
>
> dom = [1, 3, 4, 5, 7] # Plot domain on x-axis in ascending order
> of values
> ran = [7, -2, 11, 5.8, 0] # Plot range on y-axis in 1-to-1
> correspondence
> with domain items
>
> fig = plt.figure()
> ax = plt.subplot(111)
> ax.plot(dom, ran)
> plt.grid()
> plt.show()
> --- end quote ---
>
> I'm not calling numpy.arange(arg) here, but I see the expected plot of 5
> co-ordinate points. When should I use numpy.arange(arg) instead of what I
> have done above? Something to do with the domain that I want to include in
> the plot?
>
> TIA,
> Jon
>
>
Nothing is special about arange, it is just a way to generate an array of
floating point numbers, much like python's range(). You can specify start
and end values and the stepsize as well, just like for range(), except the
stepsize can be a floating point number.
In many examples, you could use python's range() and get the same results.
 All that is important is to provide coordinates for each need dimension,
from arange(), linspace(), range(), or some other source.
I hope that clears it up.
Ben Root
From: Jeffrey S. <jef...@gm...> - 2012年07月28日 04:16:21
I figured out you can pass in the rasterized keyword to all of those to
change the rasterization in the output.
Also the docs say for pcolormesh it defaults to the backend if not set.
Therefore, in the case of a vector based it would output vectors if not set
to rasterize.
Haven't tested but curious. Lets say I want to output at 600dpi but I
display images interactively at 100dpi. Does it always rasterize the image
to the higher dpi? I had noticed this didn't seem to occur in specgram but
figured because the specgram is a relatively low resolution image that
outputing at 600dpi doesn't do anything because original image is already a
low resolution. I would expect the other modes do do this where the image
isn't already output and have to rasterize the image when saving like
pcolormesh and contour plots.
Cheers,
Jeff
On Sat, Jul 28, 2012 at 1:43 PM, Jeffrey Spencer <jef...@gm...>wrote:
> Yes, specgram rasterizes and contourf is definately a vector specification
> which isn't optimal for 100 levels.
>
> I would switch to pcolormesh but the output file can't be rasterizing the
> image. It outputs a huge file in .pdf (40X bigger than equivalent .png) and
> it looks like it is vector based not rasterized.
>
>
> Basically, If you output specgram or imshow in .pdf or .png the file sizes
> are relatively comparable with .pdf, .eps, .svg being slightly larger due
> to embedding the picture.
>
> If I output in pcolor, pcolormesh, contourf (with more than 100 levels)
> the file sizes are huge for .pdf, .eps, .svg which I'm assuming because
> vector based output. It also looks like vector based output because can see
> the lines it draws for contours. Could this possibly be a selection for
> these outputs to force raster based processing or is that not easy.
>
>
> On Sat, Jul 28, 2012 at 3:26 AM, Eric Firing <ef...@ha...> wrote:
>
>> On 2012年07月26日 10:26 PM, Jeffrey Spencer wrote:
>>
>>> Thanks, that is all good info to know. I change my data to log and
>>> normalize it so the logNorm is just linear actually so specifying only
>>> levels is fine. I'll let you know if that doesn't work properly for some
>>> reason.
>>>
>>> Ok, yeah I looked at pcolormesh quickly and can't remember why I chose
>>> originally when I wrote this to go with contourf but I use to only do
>>> like 10 levels. I think it might be because use a log yaxis and think it
>>> used to be a bit funky or couldn't get it working properly but seemed
>>> fine now.
>>>
>>> No, I don't want to modify the ticks but the black lines around that
>>> like how they are removed on the major axis in this example:
>>> https://dl.dropbox.com/u/**13534143/example1.png<https://dl.dropbox.com/u/13534143/example1.png>
>>> I want to remove the black lines also around the colorbar. Not the tick
>>> marks. Does that make sense?
>>>
>>
>> cbar.outline.set_color('none')
>> or
>> cbar.outline.set_visible(**False)
>>
>>
>>
>>> One more quick question out of curiosity noticing from saving plots to
>>> .pdf from contourf and pcolormesh vs specgram. Specgram seems to output
>>> the lines and text as vector graphics. Then imbeds the image. When
>>> outputting from pcolormesh or contourf this isn't the case. It tries to
>>> write the lines or something else weird happens. Can you output to .pdf
>>> from these and make the lines and text be vectors. Then the image output
>>> as an image in the pdf like in specgram. Or is there a setting to do
>>> this and specify the .dpi of the image in the .pdf.
>>>
>>
>> Lines and text are output to pdf exactly the same by specgram,
>> pcolormesh, and contourf. The difference should be only in the image part
>> of the plot, which is rasterized for a specgram image and for the
>> "quadmesh" produced by pcolormesh, but is a set of patches (vector
>> specification, not rasterized) for contourf. Are you seeing results that
>> are inconsistent with this expectation?
>>
>> Eric
>>
>>
>>> Thanks a lot,
>>> Jeff
>>>
>>> On Fri, Jul 27, 2012 at 5:51 PM, Eric Firing <ef...@ha...
>>> <mailto:ef...@ha...>> wrote:
>>>
>>> On 2012年07月26日 9:20 PM, Jeffrey Spencer wrote:
>>>
>>> import numpy as np
>>> import matplotlib as mpl
>>> X, Y = np.meshgrid(arange(20),arange(**__20))
>>>
>>> Z = np.arange(20*20)
>>> Z = Z.reshape(20,20)
>>> logNorm = mpl.colors.Normalize(vmin=0,__**vmax=200)
>>>
>>> fig = mpl.pyplot.figure(10)
>>> ax = fig.add_subplot(111)
>>> surf = ax.contourf(X,Y,Z, 100, cmap=matplotlib.cm.jet, norm =
>>> logNorm)
>>> cbar = fig.colorbar(surf, shrink=0.70, norm=logNorm)
>>> show()
>>>
>>>
>>>
>>> OK, the basic problem here is that you are specifying 100 levels,
>>> which are being auto-selected to cover the actual data range; and
>>> the colorbar is doing what it is supposed to do, which is show the
>>> levels you actually have. Try leaving out the norm, and just
>>> specify the levels to cover what you want, more like this:
>>>
>>> surf = ax.contourf(X, Y, Z, np.arange(0, 200.1, 2), cmap=mpl.cm.jet,
>>> extend='both')
>>> cbar = fig.colorbar(surf, shrink=0.7)
>>>
>>> If you actually do want a log norm, you can pass that in to contourf
>>> and it will be passed on to colorbar; but most likely you should
>>> still specify the levels you want as an array, and not specify vmin
>>> and vmax in the norm. If you want log scaling, it may work better
>>> to simply plot the log of Z, and use the colorbar label to indicate
>>> that this is what you are doing.
>>>
>>> Note that with a recent change, you can use the set_under and
>>> set_over methods of the cmap to specify arbitrary colors, or no
>>> color, for the extended regions; or you can leave out the "extend"
>>> kwarg and not color the regions outside the range of your contour
>>> levels.
>>>
>>> In general, contourf is most appropriate when there is a moderate
>>> number of levels, well under 100; if you want that many gradations,
>>> then you might do better with pcolormesh or ax.pcolorfast or imshow.
>>> For those image-like methods, it is appropriate to use vmin and
>>> vmax, either directly, or in a norm.
>>>
>>> Eric
>>>
>>>
>>>
>>
>
From: JonBL <jc....@bi...> - 2012年07月28日 03:51:42
I'm unsure about the role of numpy method arange in Matplotlib plots. All
Matplotlib examples I have seen call numpy's method arange, and pass the
result as the first arg to Matplotlib's plot method.
But the following works as expected:
--- quote ---
import matplotlib.pyplot as plt
import numpy as np
dom = 	[1, 3, 4, 5, 7]		# Plot domain on x-axis in ascending order of values
ran = 	[7, -2, 11, 5.8, 0]	# Plot range on y-axis in 1-to-1 correspondence
with domain items
fig = plt.figure()
ax = plt.subplot(111)
ax.plot(dom, ran)
plt.grid()
plt.show()
--- end quote ---
I'm not calling numpy.arange(arg) here, but I see the expected plot of 5
co-ordinate points. When should I use numpy.arange(arg) instead of what I
have done above? Something to do with the domain that I want to include in
the plot?
TIA,
 Jon
-- 
View this message in context: http://old.nabble.com/Role-of-numpy-Method-arange-in-Matplotlib-tp34223354p34223354.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: surfcast23 <sur...@gm...> - 2012年07月28日 01:15:33
Thank you for the help!
Daπid wrote:
> 
> On Sat, Jul 28, 2012 at 12:22 AM, surfcast23 <sur...@gm...> wrote:
>> Am I reading (bins[1]-bins[0]) correctly as taking the difference
>> between
>> what is in the second and first bin?
> 
> Yes. I am multipliying the width of the bins by their total height.
> Surely there are cleaner and more general ways
> (say, when the bins are of different width), but this one does the
> trick for most cases.
> 
> And, if you have many data points, you can increase the number of bins
> (typically the square root of the number of points, if you have enough
> density) and get a more precise profile. In that case you would want
> to change the parameter of hist histype='stepfilled'
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/ValueError%3A-x-and-y-must-have-same-first-dimension-tp34218704p34223136.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Daπid <dav...@gm...> - 2012年07月28日 00:42:05
On Sat, Jul 28, 2012 at 12:22 AM, surfcast23 <sur...@gm...> wrote:
> Am I reading (bins[1]-bins[0]) correctly as taking the difference between
> what is in the second and first bin?
Yes. I am multipliying the width of the bins by their total height.
Surely there are cleaner and more general ways
(say, when the bins are of different width), but this one does the
trick for most cases.
And, if you have many data points, you can increase the number of bins
(typically the square root of the number of points, if you have enough
density) and get a more precise profile. In that case you would want
to change the parameter of hist histype='stepfilled'

Showing 9 results of 9

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