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

Showing 18 results of 18

From: Eric F. <ef...@ha...> - 2008年10月27日 23:48:44
ch...@se... wrote:
> I'm confused about what
> 
> matplotlib.pyplot.figure(figsize = (a,b)) *means*
a and b are width and height in inches. For vector backends (svg, ps, 
pdf), that's all there is to it--unless there is a bug. For non-vector 
output (screen, *.png), the a, b get translated to pixels based on the 
figure.dpi (if to the screen) or the savefig.dpi (if to a file). If you 
display such a file on the screen, or print it, the size will depend on 
the software used for that display or printing, and this is completely 
out of mpl's control.
(Actually, even for vector output, what you see upon display will depend 
on the software used for display--acroread, evince, gs, ghostview, 
etc.--and on how it is configured. But at least the vector output 
formats specify physical sizes in real units, not arbitrary pixels.)
> 
> It appears that the figure gets *bigger* as I make a and b *smaller* !??!
> 
You will need to be more explicit about what you are doing to reach this 
conclusion.
Eric
> 
> Chris
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: <bre...@un...> - 2008年10月27日 23:21:02
You need to use the numpy 'where' functionality
import numpy as np
x, y, z = np.loadtxt("fileName.dat", unpack=True) # or similar
# x, y and z are now numpy arrays and have built in functionality as 
follows:
s = (z < 10.0) & (z**2 > 0.5) # or some other constraint. Produces an 
array 's' of boolean values
plot(x[s], y[s]) # will plot only those x,y pairs for which s is True
marcusantonius <mar...@st...> 
28/10/2008 09:40 AM
To
mat...@li...
cc
Subject
[Matplotlib-users] How to plot only points which lie in a certain range
I'm sorry for this newbie question. I have a data file consisting of 3
columns, and want to plot the first versus the second column, but only if
the parameter in the third column lies in a certain range. Does somebody
have an idea how to do that?
-- 
View this message in context: 
http://www.nabble.com/How-to-plot-only-points-which-lie-in-a-certain-range-tp20178863p20178863.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's 
challenge
Build the coolest Linux based applications with Moblin SDK & win great 
prizes
Grand prize is a trip for two to an Open Source event anywhere in the 
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
UNITED GROUP
This email message is the property of United Group. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you may not disclose, copy or distribute this email, nor take or omit to take any action in reliance on it. United Group accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access.
If you have received this email in error, please notify United Group immediately by email to the sender's email address and delete this document.
From: <ch...@se...> - 2008年10月27日 23:17:08
I'm confused about what
matplotlib.pyplot.figure(figsize = (a,b)) *means*
It appears that the figure gets *bigger* as I make a and b *smaller* !??!
Chris
From: Pierre GM <bac...@gm...> - 2008年10月27日 22:59:43
On Monday 27 October 2008 18:40:07 marcusantonius wrote:
> I'm sorry for this newbie question. I have a data file consisting of 3
> columns, and want to plot the first versus the second column, but only if
> the parameter in the third column lies in a certain range. Does somebody
> have an idea how to do that?
Using masked arrays ?
import numpy as np
import numpy as ma
import matplotlib.pyplot as mpl
x = ma.arange(10)
y = ma.array(np.random.rand(10))
z = ma.array(np.random.rand(10))
(z_lo, z_up) = (0.1, 0.8)
x[ (z<z_lo) | (z>z_up) ] = ma.masked
mpl.plot(x,y, 'ok-')
Alternatively,
x = ma.masked_where((z<z_lo) | (z>z_up), x)
From: marcusantonius <mar...@st...> - 2008年10月27日 22:40:13
I'm sorry for this newbie question. I have a data file consisting of 3
columns, and want to plot the first versus the second column, but only if
the parameter in the third column lies in a certain range. Does somebody
have an idea how to do that?
-- 
View this message in context: http://www.nabble.com/How-to-plot-only-points-which-lie-in-a-certain-range-tp20178863p20178863.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Vincent Favre-N. <vi...@us...> - 2008年10月27日 22:29:16
On lundi 27 octobre 2008, Jeremy Conlin wrote:
> Thanks for introducing me to mlab. I had never heard of it before.
>
> I did:
>
> mlab.points3d(P[:,0],P[:,1],P[:,2],mode='point')
>
>
> where P is a (10000, 3) numpy array. mlab plotted the points, but the
> window became unresponsive. I can't imagine this is due to the number of
> points I'm drawing. Does anyone know what may cause this? (I'm on a mac
> running 10.5.5 with EPD.)
 I'm not sure, did you start using "ipython -wthread" ? The "-wthread" is 
required to handle the GUI - else you end up with a stuck GUI as you 
described.
 You can also try one of the test functions in mlab, e.g. 
mlab.test_points3d() - they should work if your installation is OK, again 
with the -wthread option.
 Now this may not be the best list to ask - I believe the enthought-dev list 
is where to get help for mayavi2:
https://mail.enthought.com/mailman/listinfo/enthought-dev
	Vincent
-- 
Vincent Favre-Nicolin
CEA Grenoble/INAC/SP2M			http://inac.cea.fr
Univ. Joseph Fourier (Grenoble) http://www.ujf-grenoble.fr
ObjCryst & Fox			http://objcryst.sf.net/Fox
From: Mathew Y. <mat...@gm...> - 2008年10月27日 21:20:39
Thank you!
On Mon, Oct 27, 2008 at 2:12 PM, Friedrich Hagedorn <fri...@gm...>wrote:
> On Mon, Oct 27, 2008 at 01:53:24PM -0700, Mathew Yeates wrote:
> > is there a way, when plotting many points, to decrease the size of the
> > point. With the default size I end up with overlapping points so some
> are
> > not displayed.
>
> Do you want to change (decrease) the following values?
>
> plot(range(10), '.-', linewidth=3, markersize=15) # big values for testing
>
> I hope that helps.
>
> By,
>
> Friedrich
>
From: Friedrich H. <fri...@gm...> - 2008年10月27日 21:13:04
On Mon, Oct 27, 2008 at 01:53:24PM -0700, Mathew Yeates wrote:
> is there a way, when plotting many points, to decrease the size of the
> point. With the default size I end up with overlapping points so some are
> not displayed.
Do you want to change (decrease) the following values?
 plot(range(10), '.-', linewidth=3, markersize=15) # big values for testing
I hope that helps.
By,
 Friedrich
From: Mathew Y. <mat...@gm...> - 2008年10月27日 20:53:35
is there a way, when plotting many points, to decrease the size of the
point. With the default size I end up with overlapping points so some are
not displayed.
Mathew
On Mon, Oct 27, 2008 at 10:59:40AM -0400, Michael Droettboom wrote:
> The size of the figure can be adjusted using
>
> figure(figsize=(width, height))
>
> subplots_adjust merely adjusts the margins between multiple subplots
> within the same figure.
Thanks. subplots_adjust(left=.., bottom=...) seems to have an effect on a
single plot too. It lets you add extra room for axis labels.
It *must* mess up the
aspect ratio of the plot since the axis labels are now "stealing" extra space
right?
Chris
From: John [H2O] <was...@gm...> - 2008年10月27日 16:53:03
Well, the image is being plotted using:
## create logorithmic scale
range_max = int(pl.ceil(dat_max))
step = int(pl.ceil(range_max/10)) 
logspace = 10.**np.linspace(-1, 4.0, 20) # 50 equally-spaced-in-log points
between 1.e-01 and 1.0e03
#plot#
im =
m.imshow(topodat,cmap=cm.s3pcpn,interpolation='nearest',vmin=dat_min,vmax=dat_max+(0.1*(dat_min-dat_max)))
The it is the 'Data Max' text that is of concern. Notice it does not equal
the max color according to the scale... the scatter point itself is not of
issue.
-john
Michael Droettboom-3 wrote:
> 
> The image is being plot in linear scale, while the scatter point is 
> being plotted with log scale...?
> 
> John [H2O] wrote:
>> I should add here also, this doesn't explain for me why the values are
>> different?? Thoughts on that mtter?
>>
>> Thanks!!
>>
>>
>> 
> 
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/Problems-with-imshow-logarithmic-plot-tp20152686p20191667.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Michael D. <md...@st...> - 2008年10月27日 16:19:36
The image is being plot in linear scale, while the scatter point is 
being plotted with log scale...?
John [H2O] wrote:
> I should add here also, this doesn't explain for me why the values are
> different?? Thoughts on that mtter?
>
> Thanks!!
>
>
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: John [H2O] <was...@gm...> - 2008年10月27日 16:03:20
I should add here also, this doesn't explain for me why the values are
different?? Thoughts on that mtter?
Thanks!!
-- 
View this message in context: http://www.nabble.com/Problems-with-imshow-logarithmic-plot-tp20152686p20190717.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John [H2O] <was...@gm...> - 2008年10月27日 15:44:52
Okay,
I can't find where I came up with the original solution to use imshow with
custom clevs... I think it was a thread on this forum possibly, or in an
example. But the point is that I recall there was some development talk
about improving the handling of log data for this issue.... Does anyone have
some pointers on these changes? 
I guess what you would suggest is that I interpolate the data, then use
pcolor to plot it? Thanks.
Michael Droettboom-3 wrote:
> 
> imshow doesn't handle logarithmic data. You'll want to use pcolor or 
> pcolormesh instead.
> 
> As for the graininess, unfortunately, pcolor and pcolormesh don't 
> support any kind of interpolation. (imshow does, but it can only draw 
> uniform data).
> 
> Mike
> 
> John [H2O] wrote:
>> Hello,
>>
>> I'm trying to get imshow to plot logarithmic data. I'm having some
>> problems
>> with the colorbar or data??
>>
>> Note, I plot the max_dat value on the bottom of the figure, but it does
>> not
>> seem to correspond with the values in the plot??? Any ideas? Also, does
>> anyone have some recommendations on how to better smooth the values, i.e.
>> make the plume less 'grainy'? Thanks!
>>
>> My code is here:
>> http://numpy.pastebin.com/m4ae6331a
>>
>> Example output is here:
>> http://picasaweb.google.com/washakie/Temp#5260746894103850338
>>
>> 
> 
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/Problems-with-imshow-logarithmic-plot-tp20152686p20190337.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Michael D. <md...@st...> - 2008年10月27日 14:59:51
The size of the figure can be adjusted using
figure(figsize=(width, height))
subplots_adjust merely adjusts the margins between multiple subplots 
within the same figure.
Hope that helps.
Mike
ch...@se... wrote:
> I measured the displayed Matplotlib PDF on the screen and noticed it
> has a 4/3 (1.333...) aspect ratio by default.
>
> Is it EXACTLY 4/3? Even if I do:
>
> pylab.figure().subplots_adjust(left = EXTRA_ROOM,
> bottom = EXTRA_ROOM)
>
> ???
>
> (Why doesn't the subplots_adjust command seem to mess up the default aspect
> ratio?? )
>
> Chris
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Vincent Favre-N. <vi...@us...> - 2008年10月27日 14:26:38
On lundi 27 octobre 2008, Jeremy Conlin wrote:
> I have a function (shown below) that would take a 3D numpy array and plot
> points in 3D. I recently updated my matplotlib with the latest Enthought
> Python Distribution and now it doesn't work; I guess matplotlib changed the
> api a little bit.
	Try the mlab interface to mayavi (which should be in your distribution) as a 
replacement:
http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/mlab.html
e.g. (starting with ipython -wthread):
	from enthought.mayavi import mlab
	mlab.test_points3d()
	
		Vincent
-- 
Vincent Favre-Nicolin
CEA Grenoble/INAC/SP2M			http://inac.cea.fr
Univ. Joseph Fourier (Grenoble) http://www.ujf-grenoble.fr
ObjCryst & Fox			http://objcryst.sf.net/Fox
From: Manuel M. <mm...@as...> - 2008年10月27日 14:16:33
Jeremy Conlin wrote:
> I have a function (shown below) that would take a 3D numpy array and plot
> points in 3D. I recently updated my matplotlib with the latest Enthought
> Python Distribution and now it doesn't work; I guess matplotlib changed the
> api a little bit.
> 
> The first problem arises because there is no matplotlib.axes3d anymore. I
> can't find the equivalent in the newest version. Can someone help me figure
> this out?
The axes3d support has been completely removed in matplotlib 0.98.x
> Thanks,
> Jeremy
> 
> #===================
> import matplotlib.pyplot as pyplot
> import matplotlib.axes3d as p3
> 
> def PlotPoints(P):
> """
> """
> fig = pyplot.figure()
> ax = p3.Axes3D(fig)
> ax.plot3D(P[:,0],P[:,1],P[:,2],'.')
> pyplot.show()
> return ax
> 
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jeremy C. <jer...@gm...> - 2008年10月27日 13:59:07
I have a function (shown below) that would take a 3D numpy array and plot
points in 3D. I recently updated my matplotlib with the latest Enthought
Python Distribution and now it doesn't work; I guess matplotlib changed the
api a little bit.
The first problem arises because there is no matplotlib.axes3d anymore. I
can't find the equivalent in the newest version. Can someone help me figure
this out?
Thanks,
Jeremy
#===================
import matplotlib.pyplot as pyplot
import matplotlib.axes3d as p3
def PlotPoints(P):
 """
 """
 fig = pyplot.figure()
 ax = p3.Axes3D(fig)
 ax.plot3D(P[:,0],P[:,1],P[:,2],'.')
 pyplot.show()
 return ax

Showing 18 results of 18

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