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



Showing 12 results of 12

From: Christopher B. <Chr...@no...> - 2008年12月03日 23:05:01
Elfnor wrote:
> I'm giving an introductory talk on matplotlib to colleagues next week. I'd
> like to run matplotlib in interactive mode from the PythonWin IDE. Is this
> possible?
probably not reliably -- pythonWin IDE runs things inside the same 
interpreter as the IDE itself, and therefore has problems running GUI 
code with any GUI that MPL supports.
IPython has smarts to start up MPL in another thread to avoid the issues.
Has pythonWin IDE seen any maintenance in the last five years? It may be 
time for them to move on!
On the other hand, you can still edit code with the IDE, and start it 
from a command line.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Elfnor <el...@gm...> - 2008年12月03日 22:05:15
Hi
I'm giving an introductory talk on matplotlib to colleagues next week. I'd
like to run matplotlib in interactive mode from the PythonWin IDE. Is this
possible?
I use PyScripter or occasionally IPython myself, but the python group I'm
talking to have all been set up with PythonWin and my brief is to avoid
confusing then with another IDE.
thanks Eleanor
-- 
View this message in context: http://www.nabble.com/Can-matplotlib-be-run-from-PythonWin-IDE-in-interactive-mode--tp20822638p20822638.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Eric F. <ef...@ha...> - 2008年12月03日 21:44:00
Mike Hearne wrote:
> 
> >>I don't think this is going to make it easy to do what you want
> 
> It might if I could find the x,y data in the LineCollection objects. 
> There is an undocumented function in the LineCollection class called 
> get_paths(), which looks like it returns a list of Path objects. These 
> path objects have a vertices property which looks like the stuff I want. 
> I'll explore this for a while. Anyone who knows more about these 
> objects, feel free to chime in!
Mike,
Have you tried simply making two sets of contours, one where you have 
masked out the region that you want dashed, and a second with the 
inverse of that mask? (Or, maybe the original mask and the inverted 
mask should overlap so that the contours in both regions go to their 
common boundary.) Granted, there may be edge effects between the 
regions, but it should be simple and quick.
Eric
> 
> Thanks,
> 
> Mike
> 
> 
> *Eric Firing <ef...@ha...>*
> 
> 12/03/08 01:59 PM
> 
> 	
> To
> 	Mike Hearne <mh...@us...>
> cc
> 	mat...@li...
> Subject
> 	Re: [Matplotlib-users] Contour line data
> 
> 
> 	
> 
> 
> 
> 
> 
> Mike Hearne wrote:
> >
> > How can I get the actual x,y data that represents the contour lines that
> > are drawn with the contour() function?
> >
> > I'd like to be able to redraw portions of those lines with different
> > styles (dashed, dotted, etc.)
> >
> > For example, given the following sample code (lifted from the
> > sourceforge example):
> >
> > from pylab import *
> > from numpy import *
> >
> > delta = 0.025
> > x = arange(-3.0, 3.0, delta)
> > y = arange(-2.0, 2.0, delta)
> > X, Y = meshgrid(x, y)
> > Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
> > Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
> > # difference of Gaussians
> > Z = 10.0 * (Z2 - Z1)
> > figure()
> > cs = plt.contour(X, Y, Z)
> > show()
> >
> > How could I, for example, re-draw the lines in the region X [0 1] Y
> > [-1.5 -0.5] as dashed?
> >
> > I could do it, I think, if I had the for all the lines in the plot.
> 
> I don't think this is going to make it easy to do what you want, but
> cs.collections is a list of LineCollection objects corresponding to the
> contour levels in cs.levels.
> 
> Eric
> 
From: Mike H. <mh...@us...> - 2008年12月03日 21:12:39
>>I don't think this is going to make it easy to do what you want
It might if I could find the x,y data in the LineCollection objects. There 
is an undocumented function in the LineCollection class called 
get_paths(), which looks like it returns a list of Path objects. These 
path objects have a vertices property which looks like the stuff I want. 
I'll explore this for a while. Anyone who knows more about these objects, 
feel free to chime in!
Thanks,
Mike
Eric Firing <ef...@ha...> 
12/03/08 01:59 PM
To
Mike Hearne <mh...@us...>
cc
mat...@li...
Subject
Re: [Matplotlib-users] Contour line data
Mike Hearne wrote:
> 
> How can I get the actual x,y data that represents the contour lines that 
> are drawn with the contour() function?
> 
> I'd like to be able to redraw portions of those lines with different 
> styles (dashed, dotted, etc.)
> 
> For example, given the following sample code (lifted from the 
> sourceforge example):
> 
> from pylab import *
> from numpy import *
> 
> delta = 0.025
> x = arange(-3.0, 3.0, delta)
> y = arange(-2.0, 2.0, delta)
> X, Y = meshgrid(x, y)
> Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
> Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
> # difference of Gaussians
> Z = 10.0 * (Z2 - Z1)
> figure()
> cs = plt.contour(X, Y, Z)
> show()
> 
> How could I, for example, re-draw the lines in the region X [0 1] Y 
> [-1.5 -0.5] as dashed?
> 
> I could do it, I think, if I had the for all the lines in the plot.
I don't think this is going to make it easy to do what you want, but 
cs.collections is a list of LineCollection objects corresponding to the 
contour levels in cs.levels.
Eric
From: Eric F. <ef...@ha...> - 2008年12月03日 21:00:14
Mike Hearne wrote:
> 
> How can I get the actual x,y data that represents the contour lines that 
> are drawn with the contour() function?
> 
> I'd like to be able to redraw portions of those lines with different 
> styles (dashed, dotted, etc.)
> 
> For example, given the following sample code (lifted from the 
> sourceforge example):
> 
> from pylab import *
> from numpy import *
> 
> delta = 0.025
> x = arange(-3.0, 3.0, delta)
> y = arange(-2.0, 2.0, delta)
> X, Y = meshgrid(x, y)
> Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
> Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
> # difference of Gaussians
> Z = 10.0 * (Z2 - Z1)
> figure()
> cs = plt.contour(X, Y, Z)
> show()
> 
> How could I, for example, re-draw the lines in the region X [0 1] Y 
> [-1.5 -0.5] as dashed?
> 
> I could do it, I think, if I had the for all the lines in the plot.
I don't think this is going to make it easy to do what you want, but 
cs.collections is a list of LineCollection objects corresponding to the 
contour levels in cs.levels.
Eric
From: Mike H. <mh...@us...> - 2008年12月03日 20:53:03
How can I get the actual x,y data that represents the contour lines that 
are drawn with the contour() function?
I'd like to be able to redraw portions of those lines with different 
styles (dashed, dotted, etc.)
For example, given the following sample code (lifted from the sourceforge 
example):
from pylab import *
from numpy import *
delta = 0.025
x = arange(-3.0, 3.0, delta)
y = arange(-2.0, 2.0, delta)
X, Y = meshgrid(x, y)
Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
# difference of Gaussians
Z = 10.0 * (Z2 - Z1)
figure()
cs = plt.contour(X, Y, Z)
show()
How could I, for example, re-draw the lines in the region X [0 1] Y [-1.5 
-0.5] as dashed?
I could do it, I think, if I had the for all the lines in the plot.
--Mike 
From: John H. <jd...@gm...> - 2008年12月03日 19:12:59
On Wed, Dec 3, 2008 at 9:15 AM, Nitin Bhide <nit...@ya...> wrote:
> Hi,
>
> I am getting following error while running the 'legend_demo3.py' from the examples.
>
> exec codeObject in __main__.__dict__
> File "D:\nitinb\SoftwareSources\SVNPlot\legendtest.py", line 13, in <module>
> ax1.legend(loc=1, ncol=3, shadow=True)
> File "F:\Python25\Lib\site-packages\matplotlib\axes.py", line 3617, in legend
> self.legend_ = mlegend.Legend(self, handles, labels, **kwargs)
> TypeError: __init__() got an unexpected keyword argument 'ncol'
>
> I am using ActivePython version 2.5.2 and Matplotlib version 0.98.3
We use the svn version of matplotlib to generate the website, and ncol
is a recent feature not in the main release yet. You can checkout the
svn code following the instructions at
http://matplotlib.sourceforge.net/devel/coding_guide.html
I have added a note on the gallery warning people that not all the
images are available in the latest release with a pointer to the svn
instructions.
But we would like to get a release out ASAP!
JDH
From: Nitin B. <nit...@ya...> - 2008年12月03日 15:15:51
Hi,
I am getting following error while running the 'legend_demo3.py' from the examples.
exec codeObject in __main__.__dict__
 File "D:\nitinb\SoftwareSources\SVNPlot\legendtest.py", line 13, in <module>
 ax1.legend(loc=1, ncol=3, shadow=True)
 File "F:\Python25\Lib\site-packages\matplotlib\axes.py", line 3617, in legend
 self.legend_ = mlegend.Legend(self, handles, labels, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'ncol'
I am using ActivePython version 2.5.2 and Matplotlib version 0.98.3
Regards
Nitin
 
From: Ryan M. <rm...@gm...> - 2008年12月03日 14:48:24
Nils Wagner wrote:
> Hi all,
> 
> How can I suppress xticks in a polar plot ?
import matplotlib.pyplot as plt
from matplotlib.ticker import NullFormatter
ax = plt.subplot(1, 1, 1, polar=True)
ax.xaxis.set_major_formatter(NullFormatter())
plt.show()
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Jeff W. <jef...@no...> - 2008年12月03日 13:26:12
Aleš Čadež wrote:
>
> Dear Jeffrey,
>
> First of all, sorry to bother you. I'm using matplotlib mapping 
> toolkit. Can you help me with one problem. I would like to colour 
> different countries with different colors. Is there any way to do this 
> with basemap toolkit library? I just can't seem to find any function 
> that would do that.
>
> 
>
> Thank you again,
>
> Ales Cadez
>
Ales: You need an external shapefile containing country polygons for 
this. The built-in country dataset in Basemap is made up of line 
segments, so you can't fill them. Here's a simple example to get you 
started:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap as Basemap
from matplotlib.patches import Polygon
# Robinson world map
m = Basemap(projection='robin',lon_0=0)
# draw country boundaries
# data from http://www.cipotato.org/diva/data/misc/world_adm0.zip
shp_info = m.readshapefile('world_adm0','countries',drawbounds=True)
ax = plt.gca() # get current axes instance
# fill US blue, Russia red, the rest gray.
for nshape,seg in enumerate(m.countries):
 if m.countries_info[nshape]['NAME'] == 'United States':
 poly = Polygon(seg,facecolor='b',edgecolor='b')
 elif m.countries_info[nshape]['NAME'] == 'Russia':
 poly = Polygon(seg,facecolor='r',edgecolor='r')
 else:
 poly = Polygon(seg,facecolor='0.7',edgecolor='0.7')
 ax.add_patch(poly)
# draw meridians and parallels.
m.drawparallels(np.arange(-80,81,20))
m.drawmeridians(np.arange(-180,180,60))
# draw projection limb, set background color
m.drawmapboundary(fill_color='aqua')
plt.title('US Blue, Russia Red')
plt.show()
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328
From: Nils W. <nw...@ia...> - 2008年12月03日 09:19:21
Hi all,
How can I suppress xticks in a polar plot ?
Nils
 
From: Jesper L. <jes...@gm...> - 2008年12月03日 04:44:54
Thank you for your answers and the obvious solution (banging head into wall).
Best regards,
Jesper
2008年12月1日 Jae-Joon Lee <lee...@gm...>:
> On Mon, Dec 1, 2008 at 12:56 AM, Jesper Larsen <jes...@gm...> wrote:
>> Hi Matplotlib users,
>>
>> I have a web application in which I would like to scale the plots down
>> if the users horizontal screen size is less than 800. Currently only
>> the plot is scaled while the fonts are fixed in size (see link below
>> for application). This is of course not a viable solution. I was
>> therefore wondering what the best way to scale fonts consistently with
>> figure size is. A requirement is that the scaling is thread safe (or
>> whatever it is called) in the sense that it should not affect other
>> threads executing matplotlib (since they may have different screen
>> resolutions).
>>
>
> Saving the figure with smaller dpi doesn't work?
> It is not clear how you're scaling down the over all plot (smaller
> figure size, maybe?),
> but I guess the easiest way is to have everything same and save it
> with a smaller dpi.
>
> -JJ
>

Showing 12 results of 12

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