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






Showing results of 346

<< < 1 .. 11 12 13 14 > >> (Page 13 of 14)
From: othererik <oth...@gm...> - 2010年01月08日 16:41:33
Mag,
Are you looking at time series or just a single value per user? 
Time series lends itself to a line plot. There are plenty of style options,
etc. to highlight each user and the average. 
If you're looking at a single value per user, a bar chart may be a good
choice:
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.bar
You could then show the average using a horizontal line? 
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.axhline
Mag Gam wrote:
> 
> I am new to matplot but I am liking it a lot. I am creating a webpage
> with Django and I would like to plot a user's usage and average usage.
> Therefore I am not sure what type of plot is the best type.
> 
> 
It sounds like you've already worked out using MPL in Django. I found the
following links useful if not:
http://bitsofpy.blogspot.com/2009/07/matplotlib-in-django.html
http://www.scipy.org/Cookbook/Matplotlib/Django
http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-with-django
I'm sure others have better ideas, just my 2c. 
-Erik Schweller
-- 
View this message in context: http://old.nabble.com/need-plot-advise-tp27075955p27078878.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Sven K. <ma...@kl...> - 2010年01月08日 15:26:55
Attachments: plot.pdf
Hi,
I have problems using mpl_toolkits.mplot3d.Axes3D. I plotted two surfaces, one using plot_surface, the other using plot_wireframe. However, no occlusions are handled. One surface is always in front of the other. Sometimes, the surface hides the wireframe, sometimes the other way (see attachment). How can I achieve a real 3D plot of two surfaces?
Thanks for your help
Sven
From: Mag G. <mag...@gm...> - 2010年01月08日 13:29:54
I am new to matplot but I am liking it a lot. I am creating a webpage
with Django and I would like to plot a user's usage and average usage.
Therefore I am not sure what type of plot is the best type.
The data looks like this:
user: 13.4
average: 17.5
It would also be nice if I can create a bell curve (normal
distribution) and show where the user fits into the curve.
TIA
From: Renato A. <rj...@ig...> - 2010年01月07日 21:14:31
What I'm trying to accomplish is something like:
http://bm2.genes.nig.ac.jp/RGM2/R_current/library/plotrix/man/images/big_pyramid.plot_001.png
For that I was trying to use subplots where both draw in horizontal
orientation but one will be flipped or mirrored.
I couldn't find any parameter to do so. There is left for horizontal
plots but no right. The same goes for bottom, but no top.
Is there any way to achieve this?
Thanks,
Renato
From: Alexander H. <so...@gm...> - 2010年01月07日 20:40:22
Hi, thanks for having a look at this.
Problem is that a scatter plot doesn't seem to have the option to actually
update the data, or at least I couldn't find it.
Is there maybe a way?
On Thu, Jan 7, 2010 at 2:58 AM, Laurent Dufrechou <
lau...@gm...> wrote:
> Hi alexander,
>
>
>
> I tryed yesterday to play a little with your script.
>
> I suspect that in fact each time you draw a figure, it is added to a pool
> of figure to be rendered.
>
> Thus it goes slower and slower.
>
>
>
> What I do in my scritpt is either update the datas or if the drawing is a
> completely new one (like a polar ionstaed of log previously) I delete the
> figure.
>
>
>
> To update data use:
>
>
>
> 1/self._plot, = axe.plot(x, y, 'b', animated=self._animated)
>
>
>
> Later:
>
> Loop:
>
> 2/self._plot.set_ydata(self._value)
>
>
>
>
>
> If you need to delete your figure (that is not your case, but who knows for
> the future):
>
> axe = fig.add_axes(self.getPosition())
>
> ...
>
> self._fig.delaxes(self._axe)
>
>
>
> To go even faster(x10) you have the blitting method, but set_ydata should
> be sufficent.
>
>
>
> Laurent
>
>
>
> *De :* Alexander Hupfer [mailto:so...@gm...]
> *Envoyé :* jeudi 7 janvier 2010 03:36
> *C**c :* mat...@li...
> *Objet :* Re: [Matplotlib-users] Colorbar embedding in qt4
>
>
>
> I isolated the problem a bit more. For some reason drawing gets slower and
> slower with each plot drawn.
>
> from os import sys
> from time import time
> from PyQt4 import QtGui, QtCore
>
> import matplotlib
>
> matplotlib.use('QT4Agg')
>
> from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as
> FigureCanvas
> from matplotlib.figure import Figure
>
>
> class MyMplCanvas(FigureCanvas):
> """Ultimately, this is a QWidget (as well as a FigureCanvasAgg,
> etc.)."""
> def __init__(self, parent=None, width=5, height=4, dpi=100):
> fig = Figure(figsize=(width, height), dpi=dpi)
> self.axes = fig.add_subplot(111)
> # We want the axes cleared every time plot() is called
> self.axes.hold(False)
>
> self.compute_initial_figure()
>
> #
> FigureCanvas.__init__(self, fig)
> self.setParent(parent)
>
> FigureCanvas.setSizePolicy(self,
> QtGui.QSizePolicy.Expanding,
> QtGui.QSizePolicy.Expanding)
> FigureCanvas.updateGeometry(self)
>
> def compute_initial_figure(self):
> pass
>
> class MyDynamicMplCanvas(MyMplCanvas):
> """A canvas that updates itself every second with a new plot."""
> def __init__(self, *args, **kwargs):
> MyMplCanvas.__init__(self, *args, **kwargs)
> timer = QtCore.QTimer(self)
> QtCore.QObject.connect(timer, QtCore.SIGNAL("timeout()"),
> self.update_figure)
> timer.start(0)
> self.firstrun = True
> self.colorbar = None
> self.time = time()
> self.p = None
> def compute_initial_figure(self):
> pass
>
> def update_figure(self):
> self.p = self.axes.scatter([1,2,3],[4,5,6], c = range(3),
> animated=True)
> self.axes.set_xlabel('psi')
> self.axes.set_ylabel('delta')
> if self.firstrun == True:
> self.colorbar = self.axes.figure.colorbar(self.p)
> self.firstrun = False
> self.colorbar.set_clim(vmin=0,vmax=2)
> self.colorbar.draw_all()
> self.colorbar.set_label('time [abtr. ]')
> self.draw()
> newtime = time()
> print newtime - self.time
> self.time = newtime
>
> class ApplicationWindow(QtGui.QMainWindow):
> def __init__(self):
> QtGui.QMainWindow.__init__(self)
> self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
>
> self.main_widget = QtGui.QWidget(self)
>
> l = QtGui.QVBoxLayout(self.main_widget)
>
> dc = MyDynamicMplCanvas(self.main_widget, width=5, height=4,
> dpi=100)
>
> l.addWidget(dc)
>
> self.main_widget.setFocus()
> self.setCentralWidget(self.main_widget)
>
>
> qApp = QtGui.QApplication(sys.argv)
>
> aw = ApplicationWindow()
> aw.setWindowTitle("%s" % "Slow!")
> aw.setGeometry(100,100,800,600)
> aw.show()
> sys.exit(qApp.exec_())
>
> On Mon, Jan 4, 2010 at 3:36 PM, Alexander Hupfer <so...@gm...> wrote:
>
> Ok, here is the code as a whole. I think it's still short enough to
> ilustrate the problem. Just start it with the datafile "elips" as an
> argument
>
> http://dl.dropbox.com/u/226980/elipsometry.tar.gz
>
> The timer shows how long each render cycle takes. The time seems to grow
> with number of cycles rendered even when no more points are added (the
> points are calculated with a continous rate in a background thread and are
> about 300 total).
>
>
>
> On Sun, Jan 3, 2010 at 8:16 PM, John Hunter <jd...@gm...> wrote:
>
> On Sun, Jan 3, 2010 at 7:02 PM, Alexander Hupfer <so...@gm...> wrote:
> > Thanks I got it fixed.
> > This leads to the follow up question:
> > What is the right way to keep an application responsive while the graph
> is
> > drawn?
> > Drawing a scatter plot with 300 points seems to take a while. I guess I
> need
> > to launch the drawing in another thread but don't know exactly how to do
> > this and only find examples of doing calculations in the background and
> not
> > actual widget interaction.
>
> You posted some real code and a traceback, which helped move the ball
> forward. What we really need to see to help you though is a complete,
> free-standing example, that we can run on our machines, which exposes
> the problem.
>
> JDH
>
>
>
>
>
From: James <j3...@gm...> - 2010年01月07日 17:53:29
Has anyone managed to plot a candlestick chart with a
scikits.timeseries? Is there an easy way to wrap the
matplotlib.finance.candlestick call?
James
From: Eric E. <eem...@es...> - 2010年01月07日 16:15:58
Hi
I finally managed to write a simplified version of my python script
which crashes when trying to save the figure as a postscript file. (this
is related to a previous post). See below. The script is provided, as
well as the full error message.
Sorry for the long script, but basically I am plotting 3x7 arrays via
pcolormesh. The script looks pretty dum because it was adapted from a
more complicated one where the bins/pixels are not exactly squared and
are rotated. In the version below I have tried to remove the unncessary
complication. And I get a failure from ghostscript when I try to save it
as eps. It works when I save it as a png.
Can anyone tell me what's wrong there? Again I am using:
### On an OpenSuse 11.2, 64b
xpdf distiller (but I tried others).
matplotlib 0.99.1.1
backend WXAgg version 2.8.10.1
Python 2.6.2 (r262:71600, Oct 24 2009, 03:15:21)
IPython 0.10 -- An enhanced Interactive Python.
THANKS
Eric
====================================================================
######################################################################
# Script to run which crashes when saving the figure as an eps file
######################################################################
#!/usr/bin/python
import numpy as num
import pylab as pl
def pos(i,j, w, h) :
 return [0.05+ j*(w+0.02), 0.99 - (i+1)*(h+0.023)+0.025, w, h]
## Opening the figure
## Figure
pl.figure(1, figsize=(5*1.2, 7*1.5))
fig = pl.gcf()
pl.clf()
## Size of figure
figH = fig.get_figheight()
figW = fig.get_figwidth()
w = 0.99 / 3. -0.03
h = 0.99 / 7 - 0.022
## List of data to plot (I take 7 times the same stuff)
listgal = ["1","2","3","4","5","6",",7"]
## Initialisation of start, end and step
ngal = len(listgal)
start = [-30.,-30.]
end = [30.,30.]
npix = [80,80]
x = num.linspace(start[0],end[0], npix[0])
y = num.linspace(start[1],end[1], npix[1])
step = [x[1]-x[0], y[1]-y[0]]
X,Y = num.meshgrid(x,y)
## Initialisation of data
data = num.random.random((npix[0], npix[1]))
pl.ioff()
for k in range(ngal) :
 gal = listgal[k]
 ## Coordinates
 ## Grid for rotation
 Xp,Yp = X - step[0]/2., Y - step[1]/2.
 X1,Y1 = X+step[0]/2.,Y+step[1]/2.
 X2,Y2 = X-step[0]/2.,Y+step[1]/2.
 X3,Y3 = X-step[0]/2.,Y-step[1]/2.
 X4,Y4 = X+step[0]/2.,Y-step[1]/2.
 minXc = num.min(num.concatenate((X1,X2,X3,X4)))
 maxXc = num.max(num.concatenate((X1,X2,X3,X4)))
 minYc = num.min(num.concatenate((Y1,Y2,Y3,Y4)))
 maxYc = num.max(num.concatenate((Y1,Y2,Y3,Y4)))
 dX = maxXc - minXc
 dY = maxYc - minYc
 ## Deriving the right aspect ratio etc
 aspectIma = dX / dY
 aspectFig = figW / figH
 aspectWin = w / h
 if (aspectIma < aspectWin*aspectFig) :
 maxXc = maxXc * aspectFig * aspectWin / aspectIma
 minXc = minXc * aspectFig * aspectWin / aspectIma
 else :
 maxYc = maxYc * aspectIma / (aspectFig * aspectWin)
 minYc = minYc * aspectIma / (aspectFig * aspectWin)
 extentR = minXc, maxXc, minYc, maxYc
 cmap = pl.cm.jet
 minI, maxI = 0., 1.
 cmap.set_bad('w',1.0)
 j = 0
 ax1 = fig.add_axes(pos(k,j, w, h))
 map1 = ax1.pcolormesh(Xp,Yp,data,shading='flat',vmin=minI,vmax=maxI,
cmap=cmap)
 pl.plot([0.],[0.],'k+', markersize=10, lw=3)
 xticklabels = pl.getp(pl.gca(), 'xticklabels')
 pl.setp(xticklabels, fontsize=8)
 yticklabels = pl.getp(pl.gca(), 'yticklabels')
 pl.setp(yticklabels, fontsize=8)
 pl.axis(extentR)
 j += 1
 ax2 = fig.add_axes(pos(k,j, w, h))
 map2 = ax2.pcolormesh(Xp,Yp,data,shading='flat',vmin=minI,vmax=maxI,
cmap=cmap)
 pl.plot([0.],[0.],'k+', markersize=10, lw=3)
 pl.axis(extentR)
 ax2.set_yticks([])
 xticklabels = pl.getp(pl.gca(), 'xticklabels')
 pl.setp(xticklabels, fontsize=8)
 pl.text(0.02,0.96, "%4.0f/%4.0f"%(minI,maxI),
verticalalignment='top',rotation='vertical',transform = ax2.transAxes,
fontsize=8)
 j += 1
 ax3 = fig.add_axes(pos(k,j, w, h))
 map2 = ax3.pcolormesh(Xp,Yp,data,shading='flat',vmin=0.,vmax=1.,
cmap=cmap)
 pl.plot([0.],[0.],'k+', markersize=10, lw=3)
 pl.axis(extentR)
 ax3.set_yticks([])
 xticklabels = pl.getp(pl.gca(), 'xticklabels')
 pl.setp(xticklabels, fontsize=8)
 pl.text(0.02,0.96, "%4.0f/%4.0f"%(minI,maxI),
verticalalignment='top',rotation='vertical',transform = ax3.transAxes,
fontsize=8)
 j += 1
 pl.text(0.92,0.5, gal,
rotation='vertical',verticalalignment='center',transform = ax3.transAxes)
 k += 1
pl.ion()
pl.show()
#######################################################################
## ERROR MESSAGE WHEN DOING:
## savefig("tmp.eps")
########################################################################
savefig("toto.eps")
Error: /limitcheck in --def--
Operand stack:
 pa_c2c --nostringval--
Execution stack:
 %interp_exit .runexec2 --nostringval-- --nostringval--
--nostringval-- 2 %stopped_push --nostringval-- --nostringval--
 --nostringval-- false 1 %stopped_push 1878 1 3
%oparray_pop 1877 1 3 %oparray_pop 1861 1 3 %oparray_pop
 1755 1 3 %oparray_pop --nostringval-- %errorexec_pop
.runexec2 --nostringval-- --nostringval-- --nostringval-- 2
%stopped_push --nostringval--
Dictionary stack:
 --dict:1171/3371(ro)(G)-- --dict:1/20(G)-- --dict:74/200(L)--
--dict:5/6(ro)(L)-- --dict:179/300(L)-- --dict:44/200(L)--
--dict:65534/65534(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 14229051
GPL Ghostscript 8.64: Unrecoverable error, exit code 1
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call
last)
/science/ATLAS3D/python/Analysis/Try.py in <module>()
----> 1
 2
 3
 4
 5
/usr/lib64/python2.6/site-packages/matplotlib/pyplot.pyc in
savefig(*args, **kwargs)
 354 def savefig(*args, **kwargs):
 355 fig = gcf()
--> 356 return fig.savefig(*args, **kwargs)
 357 if Figure.savefig.__doc__ is not None:
 358 savefig.__doc__ = dedent(Figure.savefig.__doc__)
/usr/lib64/python2.6/site-packages/matplotlib/figure.pyc in
savefig(self, *args, **kwargs)
 1030 patch.set_alpha(0.0)
 1031
-> 1032 self.canvas.print_figure(*args, **kwargs)
 1033
 1034 if transparent:
/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_wxagg.pyc
in print_figure(self, filename, *args, **kwargs)
 98 def print_figure(self, filename, *args, **kwargs):
 99 # Use pure Agg renderer to draw
--> 100 FigureCanvasAgg.print_figure(self, filename, *args,
**kwargs)
 101 # Restore the current view; this is needed because the
 102 # artist contains methods rely on particular attributes
/usr/lib64/python2.6/site-packages/matplotlib/backend_bases.pyc in
print_figure(self, filename, dpi, facecolor, edgecolor, orientation,
format, **kwargs)
 1474 orientation=orientation,
 1475 bbox_inches_restore=_bbox_inches_restore,
-> 1476 **kwargs)
 1477 finally:
 1478 if bbox_inches and restore_bbox:
/usr/lib64/python2.6/site-packages/matplotlib/backend_bases.pyc in
print_eps(self, *args, **kwargs)
 1327 from backends.backend_ps import FigureCanvasPS # lazy
import
 1328 ps = self.switch_backends(FigureCanvasPS)
-> 1329 return ps.print_eps(*args, **kwargs)
 1330
 1331 def print_pdf(self, *args, **kwargs):
/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_ps.pyc in
print_eps(self, outfile, *args, **kwargs)
 853
 854 def print_eps(self, outfile, *args, **kwargs):
--> 855 return self._print_ps(outfile, 'eps', *args, **kwargs)
 856
 857
/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_ps.pyc in
_print_ps(self, outfile, format, *args, **kwargs)
 882 self._print_figure_tex(outfile, format, imagedpi,
facecolor, edgecolor,
 883 orientation, isLandscape,
papertype,
--> 884 **kwargs)
 885 else:
 886 self._print_figure(outfile, format, imagedpi,
facecolor, edgecolor,
/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_ps.pyc in
_print_figure_tex(self, outfile, format, dpi, facecolor, edgecolor,
orientation, isLandscape, papertype, **kwargs)
 1188 gs_distill(tmpfile, isEPSF, ptype=papertype,
bbox=bbox)
 1189 elif rcParams['ps.usedistiller'] == 'xpdf':
-> 1190 xpdf_distill(tmpfile, isEPSF, ptype=papertype,
bbox=bbox)
 1191 elif rcParams['text.usetex']:
 1192 if False: pass # for debugging
/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_ps.pyc in
xpdf_distill(tmpfile, eps, ptype, bbox)
 1345 fh = file(outfile)
 1346 if exit_status: raise RuntimeError('ps2pdf was not able to
process your \
-> 1347 image.\n\Here is the report generated by ghostscript:\n\n' +
fh.read())
 1348 else: verbose.report(fh.read(), 'debug')
 1349 fh.close()
RuntimeError: ps2pdf was not able to process your image.
\Here is the report generated by ghostscript:
From: Manuel W. <man...@gm...> - 2010年01月07日 14:19:25
Hi,
I'm plotting two y-axis with the twinx() command. But when I'm
creating my legend there is only one entry in the legend-box instead
of two.
Here is my code:
grafik1 = plt.figure()
ax1 = grafik1.add_subplot(111)
ax1.plot(TIME, BTM, color='red', label='Biomass')
ax1.set_ylabel('Biomass')
ax2 = ax1.twinx()
ax2.plot(TIME, FLUOR, label='Productivity')
ax2.set_ylabel('Produktivity')
ax2.set_xlabel('Time')
grafik1_legend = legend(loc=10)
From: Burly C. <bu...@mt...> - 2010年01月07日 10:40:44
Attachments: doubleaxis.png
Hi,
I've been playing around with the parasite_axes toolkit. It's very nice 
but I discovered from the example that I always get an extra set of x 
and y axis labels. See attached png. I've got around this by simply 
turning the first axis off. Is this a bug in the code or the example? 
Also there appears to be an additional set of axis label commands in the 
example.
 From demo_parasite_axes2.py
----------------------------------------------------------------------
from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
import matplotlib.pyplot as plt
if 1:
 fig = plt.figure(1)
 plt.axis('off') # Extra line to remove unwanted axis labels
 host = SubplotHost(fig, 111)
 host.set_ylabel("Density")
 host.set_xlabel("Distance")
 par1 = host.twinx()
 par2 = host.twinx()
 par1.set_ylabel("Temperature")
 par2.axis["right"].set_visible(False)
 offset = 60, 0
 new_axisline = par2.get_grid_helper().new_fixed_axis
 par2.axis["right2"] = new_axisline(loc="right",
 axes=par2,
 offset=offset)
 par2.axis["right2"].label.set_visible(True)
 par2.axis["right2"].set_label("Velocity")
 fig.add_axes(host)
 plt.subplots_adjust(right=0.75)
 host.set_xlim(0, 2)
 host.set_ylim(0, 2)
 host.set_xlabel("Distance") # Why reset these three labels..
 host.set_ylabel("Density")
 par1.set_ylabel("Temperature")
 p1, = host.plot([0, 1, 2], [0, 1, 2], label="Density")
 p2, = par1.plot([0, 1, 2], [0, 3, 2], label="Temperature")
 p3, = par2.plot([0, 1, 2], [50, 30, 15], label="Velocity")
 par1.set_ylim(0, 4)
 par2.set_ylim(1, 65)
 host.legend()
 host.axis["left"].label.set_color(p1.get_color())
 par1.axis["right"].label.set_color(p2.get_color())
 par2.axis["right2"].label.set_color(p3.get_color())
 plt.draw()
 plt.show()
From: Laurent D. <lau...@gm...> - 2010年01月07日 09:58:48
Hi alexander,
 
I tryed yesterday to play a little with your script.
I suspect that in fact each time you draw a figure, it is added to a pool of
figure to be rendered.
Thus it goes slower and slower.
 
What I do in my scritpt is either update the datas or if the drawing is a
completely new one (like a polar ionstaed of log previously) I delete the
figure.
 
To update data use:
 
1/self._plot, = axe.plot(x, y, 'b', animated=self._animated)
 
Later:
Loop:
2/self._plot.set_ydata(self._value)
 
 
If you need to delete your figure (that is not your case, but who knows for
the future):
axe = fig.add_axes(self.getPosition())
… 
self._fig.delaxes(self._axe)
 
To go even faster(x10) you have the blitting method, but set_ydata should be
sufficent.
 
Laurent
 
De : Alexander Hupfer [mailto:so...@gm...] 
Envoyé : jeudi 7 janvier 2010 03:36
Cc : mat...@li...
Objet : Re: [Matplotlib-users] Colorbar embedding in qt4
 
I isolated the problem a bit more. For some reason drawing gets slower and
slower with each plot drawn.
from os import sys
from time import time
from PyQt4 import QtGui, QtCore
import matplotlib
matplotlib.use('QT4Agg')
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as
FigureCanvas
from matplotlib.figure import Figure
class MyMplCanvas(FigureCanvas):
 """Ultimately, this is a QWidget (as well as a FigureCanvasAgg,
etc.)."""
 def __init__(self, parent=None, width=5, height=4, dpi=100):
 fig = Figure(figsize=(width, height), dpi=dpi)
 self.axes = fig.add_subplot(111)
 # We want the axes cleared every time plot() is called
 self.axes.hold(False)
 self.compute_initial_figure()
 #
 FigureCanvas.__init__(self, fig)
 self.setParent(parent)
 FigureCanvas.setSizePolicy(self,
 QtGui.QSizePolicy.Expanding,
 QtGui.QSizePolicy.Expanding)
 FigureCanvas.updateGeometry(self)
 def compute_initial_figure(self):
 pass
class MyDynamicMplCanvas(MyMplCanvas):
 """A canvas that updates itself every second with a new plot."""
 def __init__(self, *args, **kwargs):
 MyMplCanvas.__init__(self, *args, **kwargs)
 timer = QtCore.QTimer(self)
 QtCore.QObject.connect(timer, QtCore.SIGNAL("timeout()"),
self.update_figure)
 timer.start(0)
 self.firstrun = True
 self.colorbar = None
 self.time = time()
 self.p = None
 def compute_initial_figure(self):
 pass
 def update_figure(self):
 self.p = self.axes.scatter([1,2,3],[4,5,6], c = range(3),
animated=True)
 self.axes.set_xlabel('psi')
 self.axes.set_ylabel('delta')
 if self.firstrun == True:
 self.colorbar = self.axes.figure.colorbar(self.p)
 self.firstrun = False
 self.colorbar.set_clim(vmin=0,vmax=2) 
 self.colorbar.draw_all()
 self.colorbar.set_label('time [abtr. ]')
 self.draw()
 newtime = time()
 print newtime - self.time
 self.time = newtime
class ApplicationWindow(QtGui.QMainWindow):
 def __init__(self):
 QtGui.QMainWindow.__init__(self)
 self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
 self.main_widget = QtGui.QWidget(self)
 l = QtGui.QVBoxLayout(self.main_widget)
 dc = MyDynamicMplCanvas(self.main_widget, width=5, height=4,
dpi=100)
 l.addWidget(dc)
 self.main_widget.setFocus()
 self.setCentralWidget(self.main_widget)
qApp = QtGui.QApplication(sys.argv)
aw = ApplicationWindow()
aw.setWindowTitle("%s" % "Slow!")
aw.setGeometry(100,100,800,600)
aw.show()
sys.exit(qApp.exec_())
On Mon, Jan 4, 2010 at 3:36 PM, Alexander Hupfer <so...@gm...> wrote:
Ok, here is the code as a whole. I think it's still short enough to
ilustrate the problem. Just start it with the datafile "elips" as an
argument
http://dl.dropbox.com/u/226980/elipsometry.tar.gz
The timer shows how long each render cycle takes. The time seems to grow
with number of cycles rendered even when no more points are added (the
points are calculated with a continous rate in a background thread and are
about 300 total).
 
On Sun, Jan 3, 2010 at 8:16 PM, John Hunter <jd...@gm...> wrote:
On Sun, Jan 3, 2010 at 7:02 PM, Alexander Hupfer <so...@gm...> wrote:
> Thanks I got it fixed.
> This leads to the follow up question:
> What is the right way to keep an application responsive while the graph is
> drawn?
> Drawing a scatter plot with 300 points seems to take a while. I guess I
need
> to launch the drawing in another thread but don't know exactly how to do
> this and only find examples of doing calculations in the background and
not
> actual widget interaction.
You posted some real code and a traceback, which helped move the ball
forward. What we really need to see to help you though is a complete,
free-standing example, that we can run on our machines, which exposes
the problem.
JDH
 
 
From: Alexander H. <so...@gm...> - 2010年01月07日 02:35:50
I isolated the problem a bit more. For some reason drawing gets slower and
slower with each plot drawn.
from os import sys
from time import time
from PyQt4 import QtGui, QtCore
import matplotlib
matplotlib.use('QT4Agg')
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as
FigureCanvas
from matplotlib.figure import Figure
class MyMplCanvas(FigureCanvas):
 """Ultimately, this is a QWidget (as well as a FigureCanvasAgg,
etc.)."""
 def __init__(self, parent=None, width=5, height=4, dpi=100):
 fig = Figure(figsize=(width, height), dpi=dpi)
 self.axes = fig.add_subplot(111)
 # We want the axes cleared every time plot() is called
 self.axes.hold(False)
 self.compute_initial_figure()
 #
 FigureCanvas.__init__(self, fig)
 self.setParent(parent)
 FigureCanvas.setSizePolicy(self,
 QtGui.QSizePolicy.Expanding,
 QtGui.QSizePolicy.Expanding)
 FigureCanvas.updateGeometry(self)
 def compute_initial_figure(self):
 pass
class MyDynamicMplCanvas(MyMplCanvas):
 """A canvas that updates itself every second with a new plot."""
 def __init__(self, *args, **kwargs):
 MyMplCanvas.__init__(self, *args, **kwargs)
 timer = QtCore.QTimer(self)
 QtCore.QObject.connect(timer, QtCore.SIGNAL("timeout()"),
self.update_figure)
 timer.start(0)
 self.firstrun = True
 self.colorbar = None
 self.time = time()
 self.p = None
 def compute_initial_figure(self):
 pass
 def update_figure(self):
 self.p = self.axes.scatter([1,2,3],[4,5,6], c = range(3),
animated=True)
 self.axes.set_xlabel('psi')
 self.axes.set_ylabel('delta')
 if self.firstrun == True:
 self.colorbar = self.axes.figure.colorbar(self.p)
 self.firstrun = False
 self.colorbar.set_clim(vmin=0,vmax=2)
 self.colorbar.draw_all()
 self.colorbar.set_label('time [abtr. ]')
 self.draw()
 newtime = time()
 print newtime - self.time
 self.time = newtime
class ApplicationWindow(QtGui.QMainWindow):
 def __init__(self):
 QtGui.QMainWindow.__init__(self)
 self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
 self.main_widget = QtGui.QWidget(self)
 l = QtGui.QVBoxLayout(self.main_widget)
 dc = MyDynamicMplCanvas(self.main_widget, width=5, height=4,
dpi=100)
 l.addWidget(dc)
 self.main_widget.setFocus()
 self.setCentralWidget(self.main_widget)
qApp = QtGui.QApplication(sys.argv)
aw = ApplicationWindow()
aw.setWindowTitle("%s" % "Slow!")
aw.setGeometry(100,100,800,600)
aw.show()
sys.exit(qApp.exec_())
On Mon, Jan 4, 2010 at 3:36 PM, Alexander Hupfer <so...@gm...> wrote:
> Ok, here is the code as a whole. I think it's still short enough to
> ilustrate the problem. Just start it with the datafile "elips" as an
> argument
>
> http://dl.dropbox.com/u/226980/elipsometry.tar.gz
>
> The timer shows how long each render cycle takes. The time seems to grow
> with number of cycles rendered even when no more points are added (the
> points are calculated with a continous rate in a background thread and are
> about 300 total).
>
>
> On Sun, Jan 3, 2010 at 8:16 PM, John Hunter <jd...@gm...> wrote:
>
>> On Sun, Jan 3, 2010 at 7:02 PM, Alexander Hupfer <so...@gm...>
>> wrote:
>> > Thanks I got it fixed.
>> > This leads to the follow up question:
>> > What is the right way to keep an application responsive while the graph
>> is
>> > drawn?
>> > Drawing a scatter plot with 300 points seems to take a while. I guess I
>> need
>> > to launch the drawing in another thread but don't know exactly how to do
>> > this and only find examples of doing calculations in the background and
>> not
>> > actual widget interaction.
>>
>> You posted some real code and a traceback, which helped move the ball
>> forward. What we really need to see to help you though is a complete,
>> free-standing example, that we can run on our machines, which exposes
>> the problem.
>>
>> JDH
>>
>
>
From: othererik <oth...@gm...> - 2010年01月06日 17:15:46
Good day all,
I've hit an infinite loop/hang using the delaunay package. Unfortunately,
I haven't been able to reproduce the issue with a nice minimal dataset, so I
don't expect much help, but I did want to note it in case.
I've been working with the delaunay package, making contour plots from
mostly unstructured data. Unfortunately, I cannot use the natgrid version
due to licensing issues, so I've been using the included delunay with mixed
results. 
I've attached a .txt file containing the data values and x,y arrays used to
create the triangulation as well as the x,y points for the grid to use for
the resulting interpolation/extrapolation results. Listing of pertinent code
is below. 
The hang occurs in the call:
 z = interp_extrap( x2, y2 )
 which, in this case is a call to the triangulations nn_interpolator(
x2, y2 )
If I use the nn_extrapolator, the hang doesn't happen, but there is a nasty
artifact.
The size of the resulting grid does not appear to matter ( so I made it
small for simplicity ).
I assume that I'm the one doing something wrong, so if there are better
approaches to this problem, don't hesitate to correct me ( please :) ). 
--See output in attached text file.
CODE:
 print 'data values:'
 print list( data_values )
 print 'data x:'
 print list( x_data_points )
 print 'data y:'
 print list( y_data_points )
 print 'start tri'
 # triangulate data (beware this can get cranky if given concave
shape)
 try:
 ltri = Triangulation( array( x_data_points ), array(
y_data_points ) )
 except Exception, err:
 raise Exception, ( 'Triangulation failed ( %s )' % err )
 print 'end tri'
 print 'start interp/extrap'
 # it seems we want the extremes of the x and y, but double check
 bbox = ( x_model_points_sorted[ 0 ], x_model_points_sorted[ -1 ], \
 y_model_points_sorted[ 0 ], y_model_points_sorted[ -1 ] )
 print 'bounding box:'
 print bbox
 if extrapolate:
 # extrapolate
 print 'extrap'
 try:
 # bounding out to region maximums for extrapolation - then
nn interpolation is applied
 interp_extrap = ltri.nn_extrapolator( array( data_values ),
bbox = bbox )
 except Exception, err:
 raise Exception, ( 'Extrapolation/Interpolation failed ( %s
)' % err )
 else:
 # interpolate
 print 'interp'
 try:
 interp_extrap = ltri.nn_interpolator( array( data_values ) )
 except Exception, err:
 raise Exception, ( 'Interpolation failed ( %s )' % err )
 print 'end interp/extrap'
 # OVERRIDE SMOOTHNESS FOR TESTING:
 self.smoothness = 0
 num_grid_points = int( self.smoothness * 200 )
 if num_grid_points == 0:
 num_grid_points = 20
 if len( x_model_points_sorted ) > num_grid_points:
 x_model_points_sorted = linspace( x_model_points_sorted[ 0 ],
x_model_points_sorted[ -1 ], num_grid_points )
 if len( y_model_points_sorted ) > num_grid_points:
 y_model_points_sorted = linspace( y_model_points_sorted[ 0 ],
y_model_points_sorted[ -1 ], num_grid_points )
 x2,y2 = meshgrid( x_model_points_sorted, y_model_points_sorted ) #
model boundary region
 print 'do the i/e'
 print 'x2 shape and y2 shape:'
 print x2.shape, ' ', y2.shape
 print 'x, grid points:'
 print x_model_points_sorted
 print 'y, grid points:'
 print y_model_points_sorted
 # run the interp/extrap step out to the bounded region on the grid
 z = interp_extrap( x2, y2 ) # HANG ON nn_interp, but not nn_extrap!
 print 'done with i/e'
:END CODE
Python version: 2.6.4
MPL version: 0.99.1
Windows XP Pro SP3
Thanks for reading,
-Erik Schweller
http://old.nabble.com/file/p27026918/boom_mpl_delaunay_output.txt
boom_mpl_delaunay_output.txt 
-- 
View this message in context: http://old.nabble.com/Delaunay-nn_interpolator-hang-tp27026918p27026918.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Gary R. <gr...@bi...> - 2010年01月06日 16:37:08
I'm happy for it to remain just a suggestion and not a reality. I 
mentioned it in case it was easy to implement alongside the color cycle 
but it seems it is not. Thanks for considering it anyway Eric,
Gary
Eric Firing wrote:
> Dominik Szczerba wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Eric Firing wrote:
>>> Dominik Szczerba wrote:
>>> OK I started hacking and added a color_cycle property to matplotlibrc.
>>> Would you be so kind to add this fix to the official version? Thanks!
>>> Dominik
From: <cha...@gm...> - 2010年01月06日 14:49:48
Dear all,
I have a little problem on understanding how to move an annotation on a 
plot.
My idea is to make a plot where some informations follow the cursor when 
moving on the data, like you can see in plots from piwik ( 
http://piwik.org/demo )
In the script in attachment, I can follow the cursor coordinate, change the 
text of the annotation, but I cannot move it.
I tried several things, but none worked.
If you have any advices, I would be very happy.
=============================
Script : try_move_annotate.py
=============================
import numpy
import matplotlib
import matplotlib.pyplot as plt
def on_motion(event):
if event.inaxes:
print "before setting position : "
print this_annotation.get_position()
this_annotation.set_text('coordinate : ' + str(event.x) + ' ' + 
str(event.y))
this_annotation.set_position((event.x, event.y))
print "after setting position : "
print this_annotation.get_position()
ax.draw_artist(this_annotation)
plt.draw()
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(10), range(10))
this_annotation = ax.annotate("coordinate : ",
xy = (100,100),
xycoords = 'figure pixels',
horizontalalignment = 'left',
verticalalignment = 'top',
fontsize = 20,
fontweight = 'bold',# animated=True,
bbox = dict(boxstyle="round", fc='black', ec="0.5", alpha=0.5)
)
fig.canvas.mpl_connect('motion_notify_event', on_motion)
plt.show()
==========
END Script
==========
From: Gergely U. <ger...@co...> - 2010年01月06日 11:06:55
Hi All,
 I'm looking for a solution to properly display histograms of data
that is neither logarithmic, nor linear. Due to the nature of my data, I
manually specify my bins (which are neither fixed width, nor
logarithmic) - what I'd like to have is for each of my bins to have
equal bar widths.
 Basically the old 'deprecated' fixed bar widths would be exactly
what I need. Is there any possibility to mimic the old behavior using
the new API? If not, it would be nice if someone re-introduced the old
fixed-width functionality or some other solution since I guess I'm not
the only one plotting statistical data with manually specified bins. In
my case relative bar widths are an eye-sore (especially since my bins
have large orders of magnitude differences, but exactly some of the
smaller ones are of interest).
 Cheers,
 Greg
From: Eric F. <ef...@ha...> - 2010年01月06日 01:18:48
Dominik Szczerba wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Eric Firing wrote:
>> Dominik Szczerba wrote:
>> OK I started hacking and added a color_cycle property to matplotlibrc.
>> Would you be so kind to add this fix to the official version? Thanks!
>> Dominik
>>
>>> Your basic idea--that the colorcycle should be settable in 
>>> rcParams--makes good sense, but the implementation needs some changes, 
>>> maybe including a bit of redesign of the color cycle handling. I will 
>>> look into it. A little discussion on the devel list may be required. I 
>>> think we will want to completely decouple lines.color from a new 
>>> lines.colorcycle, but maybe there is some good reason, other than 
>>> history, for why they are coupled.
> 
> Hi Eric,
> That's great. I would be happy if a final conclusion from the devel list
> could be forwarded here as well.
> Thanks,
> Dominik
Dominik,
I added rcParams support for the color cycle to svn, but a line style 
cycle remains at the level of a suggestion.
Eric
From: Christoph G. <cg...@uc...> - 2010年01月05日 19:20:20
On 1/5/2010 10:00 AM, Geo...@co... wrote:
> mplot3d is not in ...\site-packages\mpl_toolkits and
>
> easy_install dies looking for it. see attached err.txt
>
This might be due to a bug in setuptools 0.6c11 
<http://bugs.python.org/setuptools/issue90>. Try upgrading to setuptools 
0.6c12 or distribute <http://pypi.python.org/pypi/distribute>, or use 
the matplotlib installer from 
<http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/>.
Christoph
From: <Geo...@co...> - 2010年01月05日 18:00:38
Traceback (most recent call last):
 File "C:\Python25\Scripts\easy_install-script.py", line 8, in <module>
 load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
 File "c:\python25\lib\site-packages\setuptools\command\easy_install.py", line 1712, in main
 with_ei_usage(lambda:
 File "c:\python25\lib\site-packages\setuptools\command\easy_install.py", line 1700, in with_ei_usage
 return f()
 File "c:\python25\lib\site-packages\setuptools\command\easy_install.py", line 1716, in <lambda>
 distclass=DistributionWithoutHelpCommands, **kw
 File "C:\Python25\lib\distutils\core.py", line 151, in setup
 dist.run_commands()
 File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands
 self.run_command(cmd)
 File "C:\Python25\lib\distutils\dist.py", line 994, in run_command
 cmd_obj.run()
 File "c:\python25\lib\site-packages\setuptools\command\easy_install.py", line 211, in run
 self.easy_install(spec, not self.no_deps)
 File "c:\python25\lib\site-packages\setuptools\command\easy_install.py", line 434, in easy_install
 self.local_index
 File "c:\python25\lib\site-packages\setuptools\package_index.py", line 475, in fetch_distribution
 return dist.clone(location=self.download(dist.location, tmpdir))
AttributeError: 'NoneType' object has no attribute 'clone'
From: Reinier H. <re...@he...> - 2010年01月04日 22:59:07
Committed in R8074.
Cheers,
Reinier
On Sun, Dec 27, 2009 at 11:59 PM, Reinier Heeres <re...@he...> wrote:
> Hi all,
>
> I like this patch and it works fine. So if nobody is against including
> this, I'll commit it in a few days.
>
> I'll move the example from the class comment to an example script.
>
> Cheers,
> Reinier
>
> On Wed, Dec 2, 2009 at 1:40 PM, John Hunter <jd...@gm...> wrote:
>> On Wed, Dec 2, 2009 at 4:02 AM, Matthias Michler
>> <Mat...@gm...> wrote:
>>> Hi Jason, Hi list,
>>>
>>> First of all let me say I like the EngFormatter of Jason.
>>> Are there plans to incorparate it into matplotlib?
>>> I cannot find any indication for this in current svn, but I would like to see
>>> the EngFormatter in matplotlib. Therefore I tried to include Jasons proposal
>>> into the ticker.py as a new class EngFormatter including the
>>> method 'self.format_eng'.
>>
>>
>> I am interested in this -i I just missed Jason's original email last
>> week so thanks for bringing it back to our attention. Please post
>> this as a patch on the tracker
>>
>> http://sourceforge.net/tracker2/?group_id=80706
>>
>> since I don't have time to review it right now and I don't want it to
>> fall through the cracks.
>>
>> JDH
>>
>> ------------------------------------------------------------------------------
>> Join us December 9, 2009 for the Red Hat Virtual Experience,
>> a free event focused on virtualization and cloud computing.
>> Attend in-depth sessions from your desk. Your couch. Anywhere.
>> http://p.sf.net/sfu/redhat-sfdev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
>
> --
> Reinier Heeres
> Tel: +31 6 10852639
>
-- 
Reinier Heeres
Tel: +31 6 10852639
From: Alexander H. <so...@gm...> - 2010年01月04日 22:36:51
Ok, here is the code as a whole. I think it's still short enough to
ilustrate the problem. Just start it with the datafile "elips" as an
argument
http://dl.dropbox.com/u/226980/elipsometry.tar.gz
The timer shows how long each render cycle takes. The time seems to grow
with number of cycles rendered even when no more points are added (the
points are calculated with a continous rate in a background thread and are
about 300 total).
On Sun, Jan 3, 2010 at 8:16 PM, John Hunter <jd...@gm...> wrote:
> On Sun, Jan 3, 2010 at 7:02 PM, Alexander Hupfer <so...@gm...> wrote:
> > Thanks I got it fixed.
> > This leads to the follow up question:
> > What is the right way to keep an application responsive while the graph
> is
> > drawn?
> > Drawing a scatter plot with 300 points seems to take a while. I guess I
> need
> > to launch the drawing in another thread but don't know exactly how to do
> > this and only find examples of doing calculations in the background and
> not
> > actual widget interaction.
>
> You posted some real code and a traceback, which helped move the ball
> forward. What we really need to see to help you though is a complete,
> free-standing example, that we can run on our machines, which exposes
> the problem.
>
> JDH
>
This is actually revealing a secondary bug. It is a bug that filled 
objects are being simplified at all. For various reasons, the 
simplification algorithm is not safe for use with filled regions (mainly 
because it doesn't ensure the end points match up). The Agg backend 
turns simplification off for filled objects, but the PDF, PS and SVG 
backends were not doing this. I've committed a fix to the branch and 
trunk, so in the future, this "path.simplify: False" workaround for 
contours should not be necessary.
Mike
Eric Firing wrote:
> Jouni K. Seppänen wrote:
>> Jordan Dawe <jd...@eo...> writes:
>>
>>> Contourf plots that I output in vector format files have little
>>> triangular glitches at the contour boundaries if the contoured array
>>> is larger than about 200x200. The same files in png format are
>>> perfect, even at very high dpi values.
>>
>> The current svn trunk doesn't have the really jarring little triangles
>> (at least in the pdf output), but there are still several very obtuse
>> white triangles between the regions. Rasterization at a high dpi makes
>> the output somewhat better at the cost of larger output files:
>>
>> c=contourf(X, Y, Z, 10)
>> axis((-3, 3, -3, 3))
>> savefig('unrasterized.pdf')
>> for d in c.collections:
>> d.set_rasterized(True)
>> savefig('rasterized.pdf',dpi=200)
>
>
> At least in the trunk--and maybe in 0.99.0--the problem is caused by 
> path simplification. In the trunk, for the eps file, it goes away 
> completely if I use a matplotlibrc with
>
> path.simplify : False
>
> In the trunk, what seems to be happening is that when a contour 
> boundary is almost straight, but has an inflection point, the curves 
> for the adjacent patch boundaries are simplified slightly 
> differently. This is not surprising; if nothing else, the path will 
> be traveled in a different direction when it is an outer boundary than 
> when it is an inner boundary (for a set of concentric boundaries).
>
> Jordan, try using a local matplotlibrc with the above. Unless you are 
> already customizing via a local matplotlibrc, that line is all you need.
>
> One reason the trunk behavior differs from 0.99.0 is that contour 
> patch boundaries are now being turned into compound boundaries instead 
> of using a branch cut to connect the outside path to the inside path. 
> I suspect simplification is causing the artifacts in both cases, though.
>
> Eric
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Mark B. <ma...@gm...> - 2010年01月04日 12:59:13
Hello list, I am trying to set ticks on an Axes3D plot.
What I really want is, actually, not to have any ticks.
For a 2D plot I set the ticks to an empty list.
But in a 3D plot, I cannot set any ticks whatsover.
At least not with a sequence.
Any thoughts?
from mpl_toolkits.mplot3d import Axes3D
fig = figure()
ax = Axes3D(fig)
ax.plot([0,1],[0,1],[0,1])
# Now I want to set ticks:
ax.set_xticks([])
# ax.set_xticks([.2,.3,.4]) # changes the scale of the figure, but not the
ticks
show()
And the plot has ticks at .2 .4 .6 .8 on the x-axis.
Thanks for any help,
Mark
From: Jae-Joon L. <lee...@gm...> - 2010年01月04日 04:28:32
How about just extending the functionality of the "annotate"? I
believe it should be quite straight forward since "annotate" already
support "offset points". And "points" in matplotlib is dpi
independent.
However, I think calling "annotate" for an offset text is a bit
inconvenient for now.
annotate("Test", (0.5, 0.5), xytext=(10, 10), textcoords="offset points")
And, I prefer Eric's suggestion.
text(x, y, "Honolulu", offset = (1, 1), offset_units='ex')
So, I think one of the easiest way is to
 1) extend annotate to take offsets in some arbitrary units (we may
just add "offset fontsize", "offset ex" as an option for textcoords,
or we may add a new keyword)
 2) then modify "text" to call annotate when there is an "offset" keyword.
Philip, for now, you may use annotate, which I think is a bit easier
to use than working with transformation, and also it gives you a
dpi-independent offset.
Regards,
-JJ
From: John H. <jd...@gm...> - 2010年01月04日 03:16:46
On Sun, Jan 3, 2010 at 7:02 PM, Alexander Hupfer <so...@gm...> wrote:
> Thanks I got it fixed.
> This leads to the follow up question:
> What is the right way to keep an application responsive while the graph is
> drawn?
> Drawing a scatter plot with 300 points seems to take a while. I guess I need
> to launch the drawing in another thread but don't know exactly how to do
> this and only find examples of doing calculations in the background and not
> actual widget interaction.
You posted some real code and a traceback, which helped move the ball
forward. What we really need to see to help you though is a complete,
free-standing example, that we can run on our machines, which exposes
the problem.
JDH
From: Eric F. <ef...@ha...> - 2010年01月04日 02:25:07
Alexander Hupfer wrote:
> Thanks I got it fixed.
> This leads to the follow up question:
> What is the right way to keep an application responsive while the graph 
> is drawn?
> Drawing a scatter plot with 300 points seems to take a while. I guess I 
That's strange--a scatter plot with 1000 points looks practically 
instantaneous to me. Are you using the Axes.scatter method?
Eric
> need to launch the drawing in another thread but don't know exactly how 
> to do this and only find examples of doing calculations in the 
> background and not actual widget interaction.
> 
> - Alex
> 
> On Sun, Jan 3, 2010 at 3:37 PM, Darren Dale <dsd...@gm... 
> <mailto:dsd...@gm...>> wrote:
> 
> On Sun, Jan 3, 2010 at 5:26 PM, Alexander Hupfer <so...@gm...
> <mailto:so...@gm...>> wrote:
> > Ok, that at least fixed the tkinter error, but I still don't get
> a colorbar
> > attached to my plot. (which worked fine when I didn't embedd it
> in a Qt
> > application)
> 
> If you are importing from pylab or pyplot in your program, don't.
> These modules are not compatible with embedding.
> 
> Darren
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
25 messages has been excluded from this view by a project administrator.

Showing results of 346

<< < 1 .. 11 12 13 14 > >> (Page 13 of 14)
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 によって変換されたページ (->オリジナル) /