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






Showing results of 620

<< < 1 .. 4 5 6 7 8 .. 25 > >> (Page 6 of 25)
From: Friedrich R. <fri...@gm...> - 2010年02月23日 21:08:59
The question has been answered I think in the thread
"Graph gains a blank space at the right hand side"
just some seconds ago.
Am I wrong?
Friedrich
From: Ariel R. <ar...@be...> - 2010年02月23日 21:03:11
Hi - more generally, is there any way to control the location of the median
line, the vertical size of the box and the vertical location of the
whiskers?
Thanks - Ariel
On Tue, Feb 23, 2010 at 11:32 AM, <PH...@ge...> wrote:
>
> # ~~~~~~~~~~~~~~~~~~~
> From: Ben Axelrod [mailto:BAx...@co...]
> Sent: Tuesday, February 23, 2010 9:31 AM
> To: mat...@li...
> Subject: [Matplotlib-users] boxplot bug
>
> I found an inconsistency with how boxplots are rendered between version
> 0.99.1 and the svn head. See attached images. I have never seen a boxplot
> cross back on itself like this before. Is this the expected behavior?
>
> Thanks,
> -Ben
> # ~~~~~~~~~~~~~~~~~~~~
>
> Ben,
>
> Yes it is expected behavior. Confidence intervals around the median can
> easily go beyond the 1st and 3rd quartiles. If you're not comfortable with
> this, throw the data into R. I'm confident you'll get a similar result. I
> believe (not sure) that in the svn version you can specify that the CIs be
> computed from a bootstrapped median. Doing so might tighten the CIs up a
> bit.
>
> -Paul H.
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-- 
Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel
From: Jae-Joon L. <lee...@gm...> - 2010年02月23日 21:03:08
On Mon, Feb 22, 2010 at 11:00 AM, Geoff Bache <geo...@gm...> wrote:
> So I guess I have two questions.
> 1) Is this a bug? It certainly feels like one...
> 2) Is there a workaround / what should I do instead?
>
Try
axessubplot2.autoscale_view(tight=True)
Otherwise, you need to manually adjust xlim and ylim.
Regards,
-JJ
From: Friedrich R. <fri...@gm...> - 2010年02月23日 20:44:45
I would like to know whether the following project of mine:
http://www.friedrichromstedt.org/index.php?m=186
is useful or not, because I don't know.
I made an attempt to find something like what I tried some time ago,
but I failed.
Friedrich
From: Bruce F. <br...@cl...> - 2010年02月23日 20:37:27
I'm attempting to output an image with a predictable bounding box so
that it can be placed into a KML document and be correctly
georeferenced.
Essentially I need a PNG that has NO labeling and the size of the
image be exactly the size of the plot bounding box and no more, no
less.
I can get exactly what I want with the top and bottom of the image with:
fig.add_axes((0,0,1,1)
However, I'm still left with undesired space on the left and right.
How can I bring the left and right edges of the bounding box to match
the image width?
Also, this might be a candidate for a handy function for
pyplot.figure(). This could be very useful for anyone needing to make
KML-friendly figures.
Thanks for any ideas!
Bruce
---------------------------------------
Bruce W. Ford
Clear Science, Inc.
br...@cl...
http://www.ClearScienceInc.com
Phone/Fax: 904-379-9704
8241 Parkridge Circle N.
Jacksonville, FL 32211
Skype: bruce.w.ford
Google Talk: fo...@gm...
From: <PH...@Ge...> - 2010年02月23日 19:33:04
# ~~~~~~~~~~~~~~~~~~~
From: Ben Axelrod [mailto:BAx...@co...] 
Sent: Tuesday, February 23, 2010 9:31 AM
To: mat...@li...
Subject: [Matplotlib-users] boxplot bug
I found an inconsistency with how boxplots are rendered between version 0.99.1 and the svn head. See attached images. I have never seen a boxplot cross back on itself like this before. Is this the expected behavior?
 
Thanks,
-Ben
# ~~~~~~~~~~~~~~~~~~~~
Ben,
Yes it is expected behavior. Confidence intervals around the median can easily go beyond the 1st and 3rd quartiles. If you're not comfortable with this, throw the data into R. I'm confident you'll get a similar result. I believe (not sure) that in the svn version you can specify that the CIs be computed from a bootstrapped median. Doing so might tighten the CIs up a bit.
-Paul H.
From: Eric F. <ef...@ha...> - 2010年02月23日 19:29:16
Tornes, Ivan E wrote:
> We have a very large data set that we are trying to plot in matplotlib. 
> We found that when you have multiple data points per pixel the backend 
> does not always pick the point with the largest value to draw. If you 
> resize the plot window it changes what is being shown on the figure. 
> Narrow features of the curve vary in amplitude on resize of the plot 
> window. Is there a built in solution to fix this? 
> 
> 
Yes, see 
http://www.mail-archive.com/mat...@li.../msg15628.html
Eric
> 
> Ivan E. Tornes Ph.D.
> 
> Battelle
> 
> 505 King Avenue
> 
> Columbus, OH 43201-2693
> 
> 
> 
> Phone:614-424-5165
> 
> Fax:614-458-5165
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Tornes, I. E <to...@ba...> - 2010年02月23日 19:00:25
We have a very large data set that we are trying to plot in matplotlib. We found that when you have multiple data points per pixel the backend does not always pick the point with the largest value to draw. If you resize the plot window it changes what is being shown on the figure. Narrow features of the curve vary in amplitude on resize of the plot window. Is there a built in solution to fix this?
Ivan E. Tornes Ph.D.
Battelle
505 King Avenue
Columbus, OH 43201-2693
Phone:614-424-5165
Fax:614-458-5165
From: Jim V. <Jim...@no...> - 2010年02月23日 17:16:13
Bruce Ford wrote:
> I'm needing to keep two copies of a figure, with the properties
> different on one copy.
>
> However with logic like below, both copies remain the same regardless:
>
> #I want one copy with the defaul background and one to be transparent...
>
> imgname = GenFilename(20)+".png"
> imgsrc = "../dynamic/"+imgname
> if kml == 1:
> fig1 = fig
> fig1.frameon = False
> fig1.figurePatch.set_alpha(0.0)
> imgname1 = imgname[:-4] + "-kml.png"
> imgsrc1 = "../dynamic/"+imgname1
> fig1.savefig(imgsrc1,dpi=100,transparent=True)
> fig.savefig(imgsrc,dpi=100)
>
> So, it appears that fig1=fig doesn't make a copy, but rather links
> these figures. Is there a way to make a true separate figure that
> will allow me to alter properties in the new copy without altering the
> original.
>
> Thanks!
>
> Bruce
> ---------------------------------------
> Bruce W. Ford
> Clear Science, Inc.
> br...@cl...
> http://www.ClearScienceInc.com
> Phone/Fax: 904-379-9704
> 8241 Parkridge Circle N.
> Jacksonville, FL 32211
> Skype: bruce.w.ford
> Google Talk: fo...@gm...
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
Hello Bruce,
Have you tried the standard Python copy/deepcopy function?
My matplotlib knowledge is limited so there is probably a better 
approach, but that should work.
-- jv
From: Alan G I. <ala...@gm...> - 2010年02月23日 17:10:48
On 2/23/2010 12:03 PM, Bruce Ford wrote:
> Is there a way to make a true separate figure that
> will allow me to alter properties in the new copy without altering the
> original.
> 
def make_my_figure():
 fig = plt.figure()
 ...
 return fig
fig1 = make_my_figure()
fig2 = make_my_figure()
Alan Isaac
From: Nicolas B. <nbi...@gm...> - 2010年02月23日 17:08:16
Hi,
I cannot kill a plot by "ctrl+c" in a terminal (sending the SIGINT) when
using the Qt4Agg backend. When using GTKAgg it works fine...
What could be wrong? I need that.
Thanx!
From: Bruce F. <br...@cl...> - 2010年02月23日 17:03:36
I'm needing to keep two copies of a figure, with the properties
different on one copy.
However with logic like below, both copies remain the same regardless:
#I want one copy with the defaul background and one to be transparent...
 imgname = GenFilename(20)+".png"
 imgsrc = "../dynamic/"+imgname
 if kml == 1:
 fig1 = fig
 fig1.frameon = False
 fig1.figurePatch.set_alpha(0.0)
 imgname1 = imgname[:-4] + "-kml.png"
 imgsrc1 = "../dynamic/"+imgname1
 fig1.savefig(imgsrc1,dpi=100,transparent=True)
 fig.savefig(imgsrc,dpi=100)
So, it appears that fig1=fig doesn't make a copy, but rather links
these figures. Is there a way to make a true separate figure that
will allow me to alter properties in the new copy without altering the
original.
Thanks!
Bruce
---------------------------------------
Bruce W. Ford
Clear Science, Inc.
br...@cl...
http://www.ClearScienceInc.com
Phone/Fax: 904-379-9704
8241 Parkridge Circle N.
Jacksonville, FL 32211
Skype: bruce.w.ford
Google Talk: fo...@gm...
From: Jim V. <Jim...@no...> - 2010年02月23日 16:03:35
Hello,
I'm (unsuccessfully) trying to generate a figure (with a labeled 
colorbar) having a black background.
Here is the code.
_purpose_ = 'demonstrate capability to create PNG with black background 
including labeled color bar'
_author_ = 'jim...@no...'
import numpy # http://numpy.scipy.org/
import matplotlib # http://matplotlib.sourceforge.net/index.html
matplotlib.use('Agg') # http://matplotlib.sourceforge.net/backends.html 
-- probably the fastest, non-GUI, rendering backend
import matplotlib.pyplot as plot # 
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot
import matplotlib.cm # color maps
import sys
assert sys.version == '2.6.4 (r264:75708, Oct 26 2009, 
08:23:19) [MSC v.1500 32 bit (Intel)]', sys.version
assert numpy.__version__ == '1.4.0', numpy.__version__
assert matplotlib.__version__ == '0.99.1', matplotlib.__version__
data_min = 0
data_max = 256
data = numpy.random.randint(data_max, size=(512,512))
rows_cnt, columns_cnt = data.shape
shape = rows_cnt, columns_cnt
x = numpy.empty(data.shape, dtype=int)
y = numpy.empty(data.shape, dtype=int)
x[:] = numpy.arange(rows_cnt)
y[:] = numpy.arange(columns_cnt)
XI, YI = numpy.meshgrid(x[0], y[0])
title = 'this is the figure title'
plot.clf() # clear the figure
plot.title(title,color='white',backgroundcolor='black')
plot.axis('off')
colormap = 'gist_heat'
config = dict(cmap=eval('matplotlib.cm.%s' % colormap), vmin=data_min, 
vmax=data_max) # vmin,vmax specify a fixed (color-map) scale
plot.pcolormesh(XI, YI, data, **config)
colorbar = plot.colorbar()
##############################################################################################################################################################
# labels = ??? list of strings labels ???
labels = [str(i) for i in range(10)]
colorbar.ax.set_yticklabels(labels, color='white')
##############################################################################################################################################################
plot.imshow(data, interpolation='bilinear', cmap=config['cmap'], 
origin='upper', extent=[0,rows_cnt,0,columns_cnt])
# plot.show() # interactive
filename = 'trial-plot-with-labeled-colorbar.png'
plot.savefig(filename, facecolor='black')
plot.close()
which generates a figure with a black background and invisible (black) 
color bar labels.
I'm probably going about this completely wrong.
Questions:
 1. How do I get white color bar labels?
 2. How do I access the generated sequence of string labels (for use
 as the first set_yticklabels parameter) rather than artificially
 defining a list of labels?
Thanks,
-- jv
From: Jan S. <cur...@gm...> - 2010年02月23日 15:47:51
Gentlemen!
Thanks a lot for your help.
This works now for me (with and without the norm in the colorbar() call)
Best,
 Jan
On Tue, Feb 23, 2010 at 3:47 PM, John Hunter <jd...@gm...> wrote:
> On Mon, Feb 22, 2010 at 6:28 PM, Eric Firing <ef...@ha...> wrote:
> > Yes. You are looking at ColorbarBase, which does not have an associated
> > mappable. The derived Colorbar class does grab the cmap and norm from
> the
> > mappable used in the initialization. Is this somehow not working? Did
> you
> > really need to specify the norm explicitly?
>
> No, I didn't test this, I just read the code (apparently the wrong
> code) and concluded I needed it. I did just test w/o it and all is
> well. Sorry for the noise.
>
> JDH
>
From: John H. <jd...@gm...> - 2010年02月23日 14:47:36
On Mon, Feb 22, 2010 at 6:28 PM, Eric Firing <ef...@ha...> wrote:
> Yes. You are looking at ColorbarBase, which does not have an associated
> mappable. The derived Colorbar class does grab the cmap and norm from the
> mappable used in the initialization. Is this somehow not working? Did you
> really need to specify the norm explicitly?
No, I didn't test this, I just read the code (apparently the wrong
code) and concluded I needed it. I did just test w/o it and all is
well. Sorry for the noise.
JDH
From: John H. <jd...@gm...> - 2010年02月23日 14:40:25
On Tue, Feb 23, 2010 at 4:12 AM, Jan Strube <cur...@gm...> wrote:
> Hi John,
> thanks for keeping at it. I have updated from svn
> But this script
>  File
> "/Users/Jan/PYTHON/lib/python2.6/site-packages/matplotlib-1.0.svn_r8037-py2.6-macosx-10.6-universal.egg/matplotlib/colorbar.py",
> line 278, in _config_axes
>   ticks, ticklabels, offset_string = self._ticker()
>  File
> "/Users/Jan/PYTHON/lib/python2.6/site-packages/matplotlib-1.0.svn_r8037-py2.6-macosx-10.6-universal.egg/matplotlib/colorbar.py",
> line 417, in _ticker
>   b = np.array(locator())
>  File
> "/Users/Jan/PYTHON/lib/python2.6/site-packages/matplotlib-1.0.svn_r8037-py2.6-macosx-10.6-universal.egg/matplotlib/ticker.py",
> line 1085, in __call__
>   vmin = self.axis.get_minpos()
> AttributeError: DummyAxis instance has no attribute 'get_minpos'
Take a look at the file name in the traceback: matplotlib-1.0.svn_r8037
The r8037 is the svn revision number. According the svn log, I made
my commit on r8149, so you are not running HEAD. You may have
multiple matplotlib's installed and are not picking up the right egg.
I recommend
 > rm -rf /Users/Jan/PYTHON/lib/python2.6/site-packages/matplotlib*
and then doing a clean install from mpl svn r8149 or later.
JDH
From: Sebastian R. <seb...@go...> - 2010年02月23日 14:22:30
Hi,
has anyone a good idea how to interactively display the xy coordintes (as
whole numbers) and the pixel intensity using the mouse cursor. Here is the
code snippet:
...
fig = plt.figure()
ax1 = fig.add_subplot(111)
channel_select = 1
p = imread(filename) # normally I use TIFF file
if (p.ndim > 2):
 p1 = p[:,:,channel_select] # if more than 1 channel --> select
else:
 p1 = p
ax1.imshow(p1)
plt.show()
...
So far only the XY coordinates are displayed, but not as whole numbers and
even negative xy values are displayed, if the cursor is move to the corners
(???). And of course I would like the pixel intensity to be displayed ...
Thanks,
Sebi
From: t p. <tee...@gm...> - 2010年02月23日 14:07:20
I would like to use custom symbols (markers) on both line charts and scatter
charts. The symbols I would like to use are currently stored in PNG files.
Is there a way to convert these images to markers? Symbols are pretty simple
and contain only one colour, and the background should be transparent.
From: Kornél J. <kja...@gm...> - 2010年02月23日 10:43:56
Hi all!
I am preparing a journal article and the figures should have a fixed width
of 3 inches, with as thin white border around as possible. The figure does
an imshow with *equal* axes:
My problem is: I do not know in advance the height of my figure to specify
figsize. The height should vary so that the whole figure (with ticks,
legends and colorbanr) fits tightly into a 3 x ? inch box.
I have already tried bbox_inches='tight' for savefig and looked at HowTo
FAQ: automatically make room for tick
labels<http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels>for
possible ideas but do no have a clue yet.
Any suggestion is welcome.
Thx very much!
Kornel
From: Jon M. <jon...@ya...> - 2010年02月23日 10:34:13
Hi,
I'm using the Python(x,y) distribution which comes with matplotlib for
Windows. My OS is Windows XP with all updates and service packs on an
AMD Athlon 2600+ PC with ATI Radeon 9600 graiphics card.
Python will work fine for anything that doesn't import the pylab
component (I can import matplotlib itself no problem as well as numpy
etc) but if I try to import pylab I get:-
"An unhandled exception occured in pythonw.exe [3976]"
I've tied reinstalling Python(x,y) and even reinstalling windows then
Python(x,y) but to no avail. This seems odd to me as 2 other PCs at work
install Python(x,y) and run Pylab fine.
Any suggestions as to what I should check to track down this error?
Thanks
Jon
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4888 (20100222) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
From: Kjell M. F. <kj...@gm...> - 2010年02月23日 10:28:50
Erik Tollerud-2 wrote:
> 
> I'm curious if anyone knows a good way to embed pydot
> (http://code.google.com/p/pydot/) graphs (or really, any
> graphviz-style graphs) inside matplotlib somehow. 
> 
The closest thing is probably NetworkX (http://networkx.lanl.gov/index.html)
and PyGraphviz (http://networkx.lanl.gov/pygraphviz/)
The above tools can at least provide the position of the nodes, but I don't
think they use the drawing information provided by Graphviz.
As mentioned in another post, it is not that hard to write a Graphviz to
Matplotlib converter. Graphviz can output very detailed rendering
information when using the xdot output format
(http://www.graphviz.org/doc/info/output.html#d:xdot) Sounds like a fun
weekend project :)
- Kjell Magne Fauske
-- 
View this message in context: http://old.nabble.com/Pydot-graphs-in-matplotlib--tp27602474p27701290.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jan S. <cur...@gm...> - 2010年02月23日 10:12:18
Hi John,
thanks for keeping at it. I have updated from svn
But this script
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import LogFormatter
from matplotlib import colors
class LogFormatterHB(LogFormatter):
 def __call__(self, v, pos=None):
 vv = self._base ** v
 print vv
 return LogFormatter.__call__(self, vv, pos)
data = np.load('deltaR_parton_jet_109370.npz')
ptcut = np.logical_and(data['jetMomentum'] < 300000, data['jetMomentum']>0)
deltaRCut = data['deltaR']>0
cut = np.logical_and(ptcut, deltaRCut)
fig = plt.figure()
polycol = plt.hexbin(data['jetMomentum'][cut] / 1000, data['deltaR'][cut],
gridsize=50, norm=colors.LogNorm())
plt.title('deltaR between parton(eta<2.5) and jet(eta<2.5)')
plt.xlabel('jet pt (GeV)')
plt.ylabel('deltaR')
cb = plt.colorbar(norm=polycol.norm)
cb.set_label('# entries')
fig.savefig('hexbin_demo.png', dpi=100)
#plt.show()
gives me an error:
> python test.py
Traceback (most recent call last):
 File "test.py", line 24, in <module>
 cb = plt.colorbar(norm=polycol.norm)
 File
"/Users/Jan/PYTHON/lib/python2.6/site-packages/matplotlib-1.0.svn_r8037-py2.6-macosx-10.6-universal.egg/matplotlib/pyplot.py",
line 1356, in colorbar
 ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw)
 File
"/Users/Jan/PYTHON/lib/python2.6/site-packages/matplotlib-1.0.svn_r8037-py2.6-macosx-10.6-universal.egg/matplotlib/figure.py",
line 1104, in colorbar
 cb = cbar.Colorbar(cax, mappable, **kw)
 File
"/Users/Jan/PYTHON/lib/python2.6/site-packages/matplotlib-1.0.svn_r8037-py2.6-macosx-10.6-universal.egg/matplotlib/colorbar.py",
line 649, in __init__
 ColorbarBase.__init__(self, ax, **kw)
 File
"/Users/Jan/PYTHON/lib/python2.6/site-packages/matplotlib-1.0.svn_r8037-py2.6-macosx-10.6-universal.egg/matplotlib/colorbar.py",
line 240, in __init__
 self.draw_all()
 File
"/Users/Jan/PYTHON/lib/python2.6/site-packages/matplotlib-1.0.svn_r8037-py2.6-macosx-10.6-universal.egg/matplotlib/colorbar.py",
line 251, in draw_all
 self._config_axes(X, Y)
 File
"/Users/Jan/PYTHON/lib/python2.6/site-packages/matplotlib-1.0.svn_r8037-py2.6-macosx-10.6-universal.egg/matplotlib/colorbar.py",
line 278, in _config_axes
 ticks, ticklabels, offset_string = self._ticker()
 File
"/Users/Jan/PYTHON/lib/python2.6/site-packages/matplotlib-1.0.svn_r8037-py2.6-macosx-10.6-universal.egg/matplotlib/colorbar.py",
line 417, in _ticker
 b = np.array(locator())
 File
"/Users/Jan/PYTHON/lib/python2.6/site-packages/matplotlib-1.0.svn_r8037-py2.6-macosx-10.6-universal.egg/matplotlib/ticker.py",
line 1085, in __call__
 vmin = self.axis.get_minpos()
AttributeError: DummyAxis instance has no attribute 'get_minpos'
Cheers,
 Jan
On Tue, Feb 23, 2010 at 12:26 AM, John Hunter <jd...@gm...> wrote:
> On Mon, Feb 22, 2010 at 4:33 PM, John Hunter <jd...@gm...> wrote:
> > polycol = plt.hexbin(data['jetMomentum'][cut] / 1000,
> > data['deltaR'][cut],gridsize=50, norm=colors.LogNorm())
> > cb = plt.colorbar(norm=colors.LogNorm())
> >
> > but this appears to be broken:
>
> I committed some changes to support this -- the following now works:
>
> polycol = plt.hexbin(data['jetMomentum'][cut] / 1000,
> data['deltaR'][cut],gridsize=50, norm=colors.LogNorm())
>
> cb = plt.colorbar(norm=polycol.norm)
>
> Eric - I was surprised the colorbar does not use the mappable norm by
> default (if passed norm=None). Instead it uses ::
>
> norm = colors.Normalize()
>
> is this a feature?
>
> JDH
>
David Goldsmith wrote:
> I've searched and searched the online docs...please help.
>
> DG
> 
If I understand your question correctly you probably need to look at
http://matplotlib.sourceforge.net/api/ticker_api.html#tick-formatting
ax.xaxis.set_major_formatter( xmajorFormatter )
ax.xaxis.set_minor_formatter( xminorFormatter )
 
- Steve
From: Andrew S. <str...@as...> - 2010年02月23日 07:34:40
John Hunter wrote:
>
>
> On Mon, Feb 22, 2010 at 1:44 PM, Ben Axelrod <BAx...@co...
> <mailto:BAx...@co...>> wrote:
>
> I noticed that there are many modules in the current code base
> that are not listed at:
> http://matplotlib.sourceforge.net/modindex.html. I understand
> that a few are new files and that the documentation for these will
> be generated during the next release. But I know that most of
> these were in the last release so should have had their
> documentation generated. Am I missing something? Can the
> documentation for these modules be found somewhere else?
>
>
> You're not missing anything in terms of the html/pdf docs. When we
> converted our documentation build system to sphinx/rest, we had to
> convert our docstrings to rest as well. We made good headway for a
> while but the progress has stalled. To add a module to the
> documentation system, you need to
Also, it's worth nothing that the docs from svn head are automatically
compiled and uploaded from svn on each commit:
HTML: http://matplotlib.sourceforge.net/trunk-docs/index.html
PDF: http://matplotlib.sourceforge.net/trunk-docs/Matplotlib.pdf
-Andrew
Hi David,
I found this one::
xticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue') )
On the page
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.xticks
If I had that problem I would try to do something like that:
xvalues = linspace(0,100,1000)
xticks(xvalues, ["%.2f" % val for val in xvalues])
# or, with a lambda expression, but in #python they say 
# a list comprehension is better (faster)
xticks(xvalues, map(lambda i : "%.2f" % i, xvalues))
The side effect is, of course, that the tick is not exactly at the position he 
indicates. Maybe you better use "arange()" to get the right values for your 
ticks, just make sure that they cover the interval your xvalues are in.
If you find a better solution, please let me know.
Best regards,
Philipp
37 messages has been excluded from this view by a project administrator.

Showing results of 620

<< < 1 .. 4 5 6 7 8 .. 25 > >> (Page 6 of 25)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /