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
(21) |
3
(21) |
4
(14) |
5
(8) |
|
6
(12) |
7
(16) |
8
(27) |
9
(39) |
10
(19) |
11
(12) |
12
(3) |
|
13
(3) |
14
(18) |
15
(14) |
16
(6) |
17
(7) |
18
(19) |
19
(5) |
|
20
(8) |
21
(24) |
22
(42) |
23
(12) |
24
(11) |
25
(16) |
26
(2) |
|
27
(4) |
28
(10) |
|
|
|
|
|
|
From: Carlos G. <car...@gm...> - 2011-02-07 15:48:15
|
Hello all, I'm developing a software for Geology, using wxpython for the GUI. When I want to export any graphics, clicking on the "save" button on the MPL toolbar, I get a dialog to save the file (with a default "image.png" filename) and where I can choose between some file formats. When I select any format from the drop-down list, I expected it to change the extension of the file on the dialog, but it doesn't. So I have to set it up manually. Is this a bug? thanks -- Prof. Carlos Henrique Grohmann - Geologist D.Sc. Institute of Geosciences - Univ. of São Paulo, Brazil http://www.igc.usp.br/pessoais/guano http://lattes.cnpq.br/5846052449613692 Linux User #89721 ________________ Can’t stop the signal. |
|
From: Jouni S. <jk...@ik...> - 2011-02-07 15:38:19
|
On Feb 7, 2011, at 17:12 , Michael Anselmi wrote: > On 02/07/2011 10:06 AM, Jouni K. Seppänen wrote: >> Can you send me the pdftex.map file off-list? >> >> Thanks for the bug report, > > Certainly. See attached. Thanks. It looks like there is one font for which two encoding files are specified: pbkdo8y URWBookmanL-DemiBold ".167 SlantFont TeXnANSIEncoding ReEncodeFont" <texnansi.enc <8r.enc <ubkd8a.pfb I guess we will need to implement slightly more of a PostScript interpreter inside matplotlib to figure out which file is to be used for re-encoding the font, unless this really means some kind of a combination of the two encodings. I'll try to find out what pdftex does with this. In the meantime, I will commit a quick workaround that just disables the fonts we can't handle instead of aborting with an assert. I filed this in the bug tracker: https://sourceforge.net/tracker/?func=detail&aid=3175113&group_id=80706&atid=560720 Jouni |
|
From: Carlos G. <car...@gm...> - 2011-02-07 15:33:32
|
Hello there Is there support for exporting graphics as EMF files? >From what I've seen it seems to be discontinued. best Carlos -- Prof. Carlos Henrique Grohmann - Geologist D.Sc. Institute of Geosciences - Univ. of São Paulo, Brazil http://www.igc.usp.br/pessoais/guano http://lattes.cnpq.br/5846052449613692 Linux User #89721 ________________ Can’t stop the signal. |
|
From: Jouni K. S. <jk...@ik...> - 2011-02-07 15:07:27
|
Michael Anselmi <sel...@gm...> writes: > When trying to save a matplotlib figure as a PDF with `text.usetex = > True' in `matplotlibrc', at some point the `PsfontsMap' function in > `dviread.py' attempts to parse TeX Live 2010's `pdftex.map' file and > fails. Can you send me the pdftex.map file off-list? Thanks for the bug report, -- Jouni K. Seppänen http://www.iki.fi/jks |
|
From: Paul L. <pau...@ii...> - 2011-02-07 11:03:05
|
Hi all,
On Sun, 6 Feb 2011 03:54:48 PM Paul Leopardi wrote:
> I'm having trouble using multiple figures with mplot3d.
I have appended an entire example script, below.
The script incrementally plots 3 curves, one in each of 3 figure windows. The
trouble is, once Figure 2 has finished plotting, the curve for Figure 1
disappears and is replaced by the curve for Figure 2, with the axes for Figure
1; once Figure 3 has finished plotting, the curves for Figures 1 and 2
disappear and are replaced by the curve for Figure 3, with the axes for Figure
1 and Figure 2, respectively.
The original code was written with incremental plotting because the points
took a long time to calculate. Without incremental plotting, the figures
stayed blank for a long time. The script below is very similar to my original
script, but does not depend on my GluCat library.
Best, Paul
---
# -*- coding: utf-8 -*-
# Imports needed for array calculation and plotting.
from numpy import array, floor, random, empty, cos, pi
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
# Constants to control the plotting.
C=3 # Number of curves to plot.
P=1000 # Number of points overall.
R=2 # Scaling constant to use.
N=25 # Number of points in a curve segment.
M=P/N
# Array of points.
x=empty((3,P))
rgb=empty((3))
# Plot C curves.
for i in xrange(0,C):
# Initial point.
x0=random.randn(3)
# Plot a curve using a random bivector in R_{5,0}
# with appropriate scaling.
w=random.randn(3) * 2*pi*R/P
# Use a new figure for each curve.
fig=plt.figure(figsize=(15,12))
# ax=Axes3D(fig)
ax = fig.gca(projection='3d')
plt.show()
# Coordinate limits to determine the colour of the first curve segment.
minx=array([-x0[0],x0[1],-x0[2]])
maxx=minx.copy()
# Split the curve into M segments, each with an appropriate colour.
for j in range(0,M):
# Find N points forming a curve segment by
# exponentiating w*k for k from j*N to (j+1)*N-1.
abot=j*N
atop=abot+N
for k in xrange(abot,atop):
for h in range(0,3):
x[h,k]=x0[h]+cos(w[h]*k)
# Determine the colour of the curve segment.
amid=floor((abot+atop)/2)
for h in range(0,3):
sign=(-1)**(h+1)
minx[h]=min(minx[h],min(sign*x[h,abot:atop]))
maxx[h]=max(maxx[h],max(sign*x[h,abot:atop]))
rgb[h]=max(0.0,min((sign*x[h,amid]-minx[h])/(maxx[h]-minx[h]),1.0))
# Plot the curve segment using the chosen colour.
alow=(abot-1 if j>0 else abot)
ax.plot(x[0,alow:atop],x[1,alow:atop],x[2,alow:atop],c=rgb.tolist())
plt.draw()
plt.show()
|
|
From: Michael A. <sel...@gm...> - 2011-02-06 18:51:19
|
Hello all, I believe I have found a bug in matplotlib's `dviread.py' file. I am running Ubuntu 10.10 x86_64 and Sage 4.6.1, which includes matplotlib 1.0.0. Also I have TeX Live 2010 installed (full install from the web installer). It is important to note that the issue to be described *does not occur* when TeX Live 2009 from the Ubuntu repositories is installed instead of TeX Live 2010. The issue also occurs with matplotlib 1.0.1. When trying to save a matplotlib figure as a PDF with `text.usetex = True' in `matplotlibrc', at some point the `PsfontsMap' function in `dviread.py' attempts to parse TeX Live 2010's `pdftex.map' file and fails. Other people are having the same problem. See the following two links for more information: http://groups.google.com/group/sage-support/browse_thread/thread/dd4a97c3e06e831f (see second post) http://article.gmane.org/gmane.comp.python.matplotlib.general/26110 Here is a minimal test case to demonstrate: ---------------------------------------------------------------------- | Sage Version 4.6.1, Release Date: 2011-01-11 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- sage: from matplotlib.dviread import * sage: PsfontsMap(find_tex_file('pdftex.map')) --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) /home/michael/<ipython console> in <module>() /opt/local/sage/local/lib/python2.6/site-packages/matplotlib/dviread.pyc in __init__(self, filename) 666 file = open(filename, 'rt') 667 try: --> 668 self._parse(file) 669 finally: 670 file.close() /opt/local/sage/local/lib/python2.6/site-packages/matplotlib/dviread.pyc in _parse(self, file) 699 while pos < len(line) and line[pos] == ' ': 700 pos += 1 --> 701 self._register(words) 702 703 def _register(self, words): /opt/local/sage/local/lib/python2.6/site-packages/matplotlib/dviread.pyc in _register(self, words) 725 encoding = word[1:] 726 elif word.endswith('.enc'): --> 727 assert encoding is None 728 encoding = word 729 else: AssertionError: sage: Here is some debug information (the last two lines may be relevant): $HOME=/home/michael CONFIGDIR=/home/michael/.sage//matplotlib-1.0.0 matplotlib data path /opt/local/sage/local/lib/python2.6/site-packages/matplotlib/mpl-data loaded rc file /opt/local/sage/local/lib/python2.6/site-packages/matplotlib/mpl-data/matplotlibrc matplotlib version 1.0.0 verbose.level debug interactive is False units is False platform is linux2 loaded modules: ['numpy.lib._iotools', 'xml.sax.urlparse', 'distutils', 'numpy.lib.npyio', 'matplotlib.errno', 'matplotlib.matplotlib', '_bisect', 'subprocess', 'gc', 'matplotlib.tempfile', 'distutils.sysconfig', 'ctypes._endian', 'encodings.encodings', 'matplotlib.colors', 'numpy.core.numerictypes', 'numpy.testing.sys', 'numpy.core.info', 'xml', 'numpy.fft.types', 'numpy.ma.cPickle', 'struct', 'numpy.matrixlib.defmatrix', 'numpy.random.info', 'tempfile', 'numpy.compat.types', 'base64', 'numpy.linalg', 'matplotlib.threading', 'numpy.core.machar', 'numpy.testing.types', 'numpy.testing', 'collections', 'numpy.polynomial.sys', 'numpy.core.umath', 'distutils.types', 'numpy.testing.operator', 'numpy.lib.numpy', 'numpy.core.scalarmath', 'numpy.ma.sys', 'zipimport', 'string', 'matplotlib.subprocess', 'numpy.testing.os', 'matplotlib.locale', 'numpy.lib.arraysetops', 'numpy.testing.unittest', 'numpy.lib.math', 'encodings.utf_8', 'matplotlib.__future__', 'ssl', 'numpy.testing.re', 'itertools', 'numpy.version', 'numpy.lib.re', 'distutils.re', 'numpy.matrixlib.sys', 'ctypes.os', 'numpy.core.os', 'numpy.lib.type_check', 'numpy.compat.sys', 'numpy.lib.__builtin__', 'signal', 'numpy.lib.types', 'numpy.lib._datasource', 'random', 'numpy.ma.extras', 'numpy.fft.fftpack_lite', 'matplotlib.cbook', 'ctypes.ctypes', 'xml.sax.xmlreader', 'numpy.polynomial.string', 'distutils.version', 'cStringIO', 'numpy.polynomial', 'numpy.numpy', 'matplotlib.StringIO', 'locale', 'numpy.add_newdocs', 'numpy.core.getlimits', 'xml.sax.saxutils', 'numpy.lib.sys', 'encodings', 'numpy.ma.itertools', 'array', 'StringIO', 'abc', 'numpy.matrixlib', 'numpy.ctypes', 'numpy.testing.decorators', 'matplotlib.warnings', 'rfc822', 'matplotlib.string', 'urllib', 'matplotlib.sys', 're', 'numpy.lib._compiled_base', 'threading', 'new', 'numpy.random.mtrand', 'urllib2', 'matplotlib.cPickle', 'math', 'numpy.fft.helper', 'fcntl', 'numpy.ma.warnings', 'matplotlib.numpy', 'UserDict', 'numpy.lib.function_base', 'distutils.os', 'matplotlib', 'numpy.fft.numpy', 'xml.sax.codecs', 'exceptions', 'numpy.lib.info', 'ctypes', 'numpy.lib.warnings', 'ctypes.struct', 'codecs', 'numpy.core._sort', 'numpy.os', '_functools', '_locale', 'numpy.__builtin__', 'matplotlib.sre_constants', 'matplotlib.os', 'thread', 'numpy.lib.ufunclike', 'numpy.core.memmap', 'traceback', 'numpy.testing.warnings', 'weakref', 'numpy.core._internal', 'numpy.compat._inspect', 'numpy.linalg.lapack_lite', 'numpy.ma', 'distutils.sys', 'os', 'marshal', 'numpy.lib.itertools', '__future__', 'matplotlib.copy', 'xml.sax.types', 'matplotlib.traceback', '_sre', 'unittest', 'numpy.core.sys', 'numpy.random', 'numpy.linalg.numpy', '__builtin__', 'numpy.lib.twodim_base', 'numpy.ma.core', 'matplotlib.re', 'numpy.core.cPickle', 'operator', 'numpy.polynomial.polytemplate', 'numpy.core.arrayprint', 'distutils.string', 'numpy.lib.arrayterator', 'select', 'ctypes._ctypes', 'ctypes.sys', 'matplotlib.datetime', 'posixpath', 'numpy.lib.financial', 'numpy.core.multiarray', 'errno', '_socket', 'binascii', 'sre_constants', 'datetime', 'numpy.core.shape_base', 'functools', 'xml.sax.handler', 'os.path', 'numpy.core.function_base', 'numpy.compat.py3k', 'numpy.lib.stride_tricks', 'numpy.core.numpy', 'numpy', '_warnings', 'numpy.polynomial.chebyshev', 'matplotlib.types', 'xml.sax.os', 'cPickle', 'encodings.__builtin__', 'numpy.polynomial.warnings', 'matplotlib.xml', 'matplotlib.new', '_codecs', 'numpy.lib.operator', 'numpy.polynomial.polynomial', 'numpy.__config__', '_collections', 'matplotlib.pyparsing', 'httplib', 'numpy.ma.numpy', 'copy', 'numpy.core.re', '_struct', 'numpy.core.fromnumeric', 'hashlib', 'numpy.ctypeslib', 'keyword', 'numpy.lib.scimath', 'numpy.fft', 'numpy.lib', 'bisect', 'numpy.random.numpy', 'matplotlib.urllib2', 'matplotlib.random', 'numpy.polynomial.__future__', 'posix', 'encodings.aliases', 'matplotlib.fontconfig_pattern', 'fnmatch', 'sre_parse', 'pickle', 'numpy.core.ctypes', 'mimetools', 'distutils.distutils', 'copy_reg', 'sre_compile', 'xml.sax', 'numpy.fft.fftpack', '_random', '_ctypes', 'numpy.lib.__future__', 'site', 'numpy.lib.polynomial', 'numpy.compat', 'numpy._import_tools', '__main__', 'numpy.fft.info', 'numpy.core.records', 'shutil', 'numpy.lib.cPickle', 'numpy.sys', 'matplotlib.weakref', 'xml.sax.urllib', 'numpy.core._dotblas', 'numpy.testing.traceback', 'strop', 'numpy.testing.numpytest', 'numpy.polynomial.numpy', 'numpy.core.numeric', 'numpy.linalg.info', 'encodings.codecs', '_abcoll', 'numpy.core', 'matplotlib.rcsetup', 'matplotlib.time', 'xml.sax._exceptions', 'genericpath', 'stat', '_ssl', 'numpy.lib.index_tricks', 'numpy.testing.utils', 'warnings', 'numpy.lib.utils', 'numpy.core.defchararray', 'numpy.polynomial.polyutils', 'numpy.lib.shape_base', 'numpy.core.types', 'textwrap', 'sys', '_hashlib', 'numpy.core.warnings', 'socket', 'numpy.core.__builtin__', 'xml.sax.sys', 'numpy.lib.format', 'numpy.lib.os', 'numpy.testing.nosetester', 'types', 'numpy.lib.shutil', 'matplotlib.distutils', '_weakref', 'distutils.errors', 'numpy.matrixlib.numpy', 'urlparse', 'linecache', 'matplotlib.shutil', 'numpy.lib.cStringIO', 'time', 'numpy.linalg.linalg', 'numpy.testing.numpy'] find_tex_file(pdftex.map): ['kpsewhich', 'pdftex.map'] find_tex_file result: /usr/local/texlive/2010/texmf-var/fonts/map/pdftex/updmap/pdftex.map Please let me know if there's anything more I may do to help fix whatever is going awry here. -Michael |
|
From: Benjamin R. <ben...@ou...> - 2011-02-06 18:16:00
|
On Sat, Feb 5, 2011 at 10:54 PM, Paul Leopardi <pau...@ii...>wrote: > Hi all, > I'm having trouble using multiple figures with mplot3d. Once each new > figure > is plotted, the plots from new figure is also displayed in all of the old > figures. For example, once the plot for figure 2 has finished, the plot fo > figure 1 is replaced by a copy of the plot for figure 2, and so on... > I have included an abbreviated version of my script code. My original code > uses Cython and my GluCat library, but I am fairly sure the cause of the > problem lies either with mplot3d or with my Python script code. > > I am using openSUSE 11.2 with > python-base-2.6.2-6.7.1.x86_64 > python-matplotlib-1.0.1-20.1.x86_64 > python-matplotlib-tk-1.0.1-20.1.x86_64 > python-matplotlib-wx-1.0.1-20.1.x86_64 > > Best, Paul > > Script excerpt: > > ... > from mpl_toolkits.mplot3d import Axes3D > import matplotlib.pyplot as plt > ... > # Plot C curves. > for i in xrange(0,C): > ... > # Use a new figure for each curve. > fig=plt.figure(figsize=(15,12)) > ax = fig.gca(projection='3d') > plt.show() > ... > # Split the curve into M segments, each with an appropriate colour. > for j in range(0,M): > # Find N points forming a curve segment ... > # Determine the colour of the curve segment... > # Plot the curve segment using the chosen colour. > alow=(abot-1 if j>0 else abot) > ax.plot(x[0,alow:atop],x[1,alow:atop],x[2,alow:atop],c=rgb.tolist()) > plt.draw() > plt.show() > > Paul, I am not exactly sure what your sample script is trying to do. Could you please attach a short self-contained working script that demonstrates your problem? Ben Root |
|
From: Laurent <mok...@gm...> - 2011-02-06 15:12:08
|
> Your data are embedded in a Line2d object which is itself a child of an
> Axes, itself child of the figure. Try:
> Fig = F.matplotlib()
> ax = Fig.get_axes()[0] # to get the first (and maybe only) subplot
> line = ax.get_axes()[0]
> xdata = line.get_xdata()
> ydata = line.get_ydata()
There is something wrong ...
sage: var('x,y')
(x, y)
sage: F=implicit_plot(x**2+y**2==1,(x,-5,5),(y,-5,5))
sage: Fig = F.matplotlib()
sage: ax = Fig.get_axes()[0] <-- I checked : it is the only element :)
sage: line = ax.get_axes()[0]
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
TypeError: 'AxesSubplot' object does not support indexing
sage:line=ax.get_axes()
sage:type(line)
<class 'matplotlib.axes.AxesSubplot'>
However, using some "grep get_ydata" from that point, I suceed to track
my information.
It was in the segments argument of matplotlib.collections.LineCollection
Now I'm tracking back the information ... It is in
mcontour.QuadContourSet(self, *args, **kwargs).allsegs
in the method matplotlib.axes.Axes.contour()
I'm almost done.
Thanks for help !
Have a nice afternoon
Laurent
PS :
I'll post the final answer here :
http://ask.sagemath.org/question/359/get_minmax_data-on-implicit_plot
PPS :
Argh !! Someone already did !
|
|
From: Fabrice S. <si...@lm...> - 2011-02-06 14:15:21
|
Le dimanche 06 février 2011 à 14:29 +0100, Laurent a écrit :
> If it can help, I have the following in a Sage terminal :
>
> sage: var('x,y')
> sage: F=implicit_plot(x**2+y**2==2,(x,-5,5),(y,-5,5),plot_points=100)
> sage: F.matplotlib()
> <matplotlib.figure.Figure object at 0xbfb60ac>
> sage: F.matplotlib().get_children()
> [<matplotlib.patches.Rectangle object at 0xc144e4c>,
> <matplotlib.axes.AxesSubplot object at 0xc14472c>]
>
> I really do not understand where is the data ??? In the Rectangle ? In
> the Axes ?
Your data are embedded in a Line2d object which is itself a child of an
Axes, itself child of the figure. Try:
Fig = F.matplotlib()
ax = Fig.get_axes()[0] # to get the first (and maybe only) subplot
line = ax.get_axes()[0]
xdata = line.get_xdata()
ydata = line.get_ydata()
--
Fabrice Silva
|
|
From: Tom v. d. H. <To...@va...> - 2011-02-06 13:37:47
|
Dear Sebastian,
Your solution is simple, well described and it works with minimal effort
Thank you so much!
I hope the Matplotlib devellopers will take some action.
Tom
Op 6-2-2011 13:16, Sebastian Voigt schreef:
> Hello Tom,
>
> I encountered the same problem recently. The toolbar icons are a mix of
> png and svg images. The png images are displayed properly while the svg
> icons are not shown. This is a problem with PyQt. I found a proposal on
> the web, where you should add the line
>
> import PyQt4.QtXml
>
> somewhere to your code. This is because xml support is needed to read
> svg files. However, this did not work for me. Instead I now use a rather
> ugly workaround: I rename the original *.png icon files to *.svg for
> those icons that are expected to be svg files. Qt will then find an svg
> file but it's clever enough to load it as png.
> Save those modified files somewhere as resources. Add them to the
> data_files list in your setup script and they will overwrite the
> original files at every build so you don't have to care any more.
>
> You can find out which files have to be renamed by looking into
> PACKAGEPATH/matplotlib/backends/backend_qt4.py line 399 and below.
> Another approach would be to directly rename the files in
> NavigationToolbar2QT._init_toolbar() to *.png since matplotlib provides
> png and svg files for every icon.
>
> Greetings,
> Sebastian
>
>
> Am 06.02.2011 11:20, schrieb Tom van der Hoeven:
>> Hello,
>>
>> I have a simple program
>> ---------------graf.py--------------
>>
>> import matplotlib.pyplot as plt
>> plt.plot([1,2,3,8,0,9,1,10,5])
>> plt.ylabel('some numbers')
>> plt.show()
>> --------------------------------------------------
>> If I look to a matplotlib figures on my screen using the exe made with
>> py2exe I mis all the buttons but one of the navigation bar.
>> If I work direct with the Python interpreted they are there.
>> I use the current version of Pythonxy
>>
>> ------------ setup.py --------------
>> from distutils.core import setup
>> import py2exe
>> import matplotlib
>>
>> name = 'graf.py'
>> INCLUDES = [ 'sip' , 'matplotlib.numerix.random_array'
>> # , 'PyQt4._qt'
>> , 'matplotlib.backends'
>> ,
>> 'matplotlib.backends.backend_qt4agg']
>> #['matplotlib.backends.backend_qt4agg']
>> EXCLUDES = []
>> [ '_gtkagg' , '_tkagg' , 'Tkconstants' , 'Tkinter' ,'tcl' ]
>> #['_tkagg' , '_ps' , '_fltkagg' , 'Tkinter' , 'Tkconstants' , '_cairo' ,
>> '_gtk' , 'gtkcairo' ,
>> # 'pydoc' , 'sqlite3' , 'bsddb' , 'curses' , 'tcl' ,
>> '_wxagg' , '_gtagg' , '_cocoaagg' , '_wx' ]
>> DLL_EXCLUDES = ['MSVCP90.dll']
>> ICON_RESOURSES = []
>> OTHER_RESOURCES = []
>> DATA_FILES = matplotlib.get_py2exe_datafiles()
>>
>> setup(name = name,
>> version = '1.0',
>> options = { "py2exe" : { 'compressed' : 1,
>> 'optimize' : 2,
>> 'bundle_files' : 2,
>> 'includes' : INCLUDES,
>> 'excludes' : EXCLUDES,
>> 'dll_excludes' : DLL_EXCLUDES }
>> } ,
>> console = [ { 'script' : name,
>> 'icon_resources' : ICON_RESOURSES,
>> 'other_resources' : OTHER_RESOURCES, } ] ,
>> description = 'Hele mooie',
>> author = 'Tom van der Hoeven',
>> author_email = 'To...@va...' ,
>> maintainer = 'Tom van der Hoeven',
>> maintainer_email = 'To...@va...',
>> license = '',
>> url = 'http://projecthomepage.com',
>> data_files = DATA_FILES,
>> )
>> -------------------------
>> can you help me
>>
>> Tom
>>
>> ------------------------------------------------------------------------------
>> The modern datacenter depends on network connectivity to access resources
>> and provide services. The best practices for maximizing a physical server's
>> connectivity to a physical network are well understood - see how these
>> rules translate into the virtual world?
>> http://p.sf.net/sfu/oracle-sfdevnlfb
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
> ------------------------------------------------------------------------------
> The modern datacenter depends on network connectivity to access resources
> and provide services. The best practices for maximizing a physical server's
> connectivity to a physical network are well understood - see how these
> rules translate into the virtual world?
> http://p.sf.net/sfu/oracle-sfdevnlfb
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Laurent <mok...@gm...> - 2011-02-06 13:29:16
|
Hello all !
I'm sorry if my question is not clear, but I do not know ho to produce a
simple example.
I'm plotting the graph of an implicit given function (say x^2+y^2=3)
using Sage.
What I know it that
1. when I ask sage to plot implicit_plot( f==3,(x,-5,5),(y,-5,5) ),
Sage computes f-3 on an array of points in the square (-5,-5)x(5,5).
2. Sage creates an object matplotlib.figure.Figure that contains
somewhere the information about the array of computed points and ask
matplotlib to plot it
What I understood is that somewhere in matplotlib, the values are parsed
and a path is created. That path is the set of points on which f-3=0
My aim : catch the set of points that satisfy f-3=0. That has to be
stored --or at last computed-- somewhere in matplotlib.figure.Figure
I read the source, but I'm really lost.
The final purpose is to know the bounding box of the points that are
*actually* plotted without taking into account the axes, labels and
other decorations.
Does someone know how to do that ?
Since the object I have on hand is created by Sage[1] in a quite complex
way, I'm sorry to not being able to furnish an example.
Thanks
Laurent
If it can help, I have the following in a Sage terminal :
sage: var('x,y')
sage: F=implicit_plot(x**2+y**2==2,(x,-5,5),(y,-5,5),plot_points=100)
sage: F.matplotlib()
<matplotlib.figure.Figure object at 0xbfb60ac>
sage: F.matplotlib().get_children()
[<matplotlib.patches.Rectangle object at 0xc144e4c>,
<matplotlib.axes.AxesSubplot object at 0xc14472c>]
I really do not understand where is the data ??? In the Rectangle ? In
the Axes ?
On the Sage's side, the discussion is here :
http://ask.sagemath.org/question/359/get_minmax_data-on-implicit_plot
[1] www.sagemath.org
|
|
From: Sebastian V. <sv...@gm...> - 2011-02-06 12:16:59
|
Hello Tom,
I encountered the same problem recently. The toolbar icons are a mix of
png and svg images. The png images are displayed properly while the svg
icons are not shown. This is a problem with PyQt. I found a proposal on
the web, where you should add the line
import PyQt4.QtXml
somewhere to your code. This is because xml support is needed to read
svg files. However, this did not work for me. Instead I now use a rather
ugly workaround: I rename the original *.png icon files to *.svg for
those icons that are expected to be svg files. Qt will then find an svg
file but it's clever enough to load it as png.
Save those modified files somewhere as resources. Add them to the
data_files list in your setup script and they will overwrite the
original files at every build so you don't have to care any more.
You can find out which files have to be renamed by looking into
PACKAGEPATH/matplotlib/backends/backend_qt4.py line 399 and below.
Another approach would be to directly rename the files in
NavigationToolbar2QT._init_toolbar() to *.png since matplotlib provides
png and svg files for every icon.
Greetings,
Sebastian
Am 06.02.2011 11:20, schrieb Tom van der Hoeven:
> Hello,
>
> I have a simple program
> ---------------graf.py--------------
>
> import matplotlib.pyplot as plt
> plt.plot([1,2,3,8,0,9,1,10,5])
> plt.ylabel('some numbers')
> plt.show()
> --------------------------------------------------
> If I look to a matplotlib figures on my screen using the exe made with
> py2exe I mis all the buttons but one of the navigation bar.
> If I work direct with the Python interpreted they are there.
> I use the current version of Pythonxy
>
> ------------ setup.py --------------
> from distutils.core import setup
> import py2exe
> import matplotlib
>
> name = 'graf.py'
> INCLUDES = [ 'sip' , 'matplotlib.numerix.random_array'
> # , 'PyQt4._qt'
> , 'matplotlib.backends'
> ,
> 'matplotlib.backends.backend_qt4agg']
> #['matplotlib.backends.backend_qt4agg']
> EXCLUDES = []
> [ '_gtkagg' , '_tkagg' , 'Tkconstants' , 'Tkinter' ,'tcl' ]
> #['_tkagg' , '_ps' , '_fltkagg' , 'Tkinter' , 'Tkconstants' , '_cairo' ,
> '_gtk' , 'gtkcairo' ,
> # 'pydoc' , 'sqlite3' , 'bsddb' , 'curses' , 'tcl' ,
> '_wxagg' , '_gtagg' , '_cocoaagg' , '_wx' ]
> DLL_EXCLUDES = ['MSVCP90.dll']
> ICON_RESOURSES = []
> OTHER_RESOURCES = []
> DATA_FILES = matplotlib.get_py2exe_datafiles()
>
> setup(name = name,
> version = '1.0',
> options = { "py2exe" : { 'compressed' : 1,
> 'optimize' : 2,
> 'bundle_files' : 2,
> 'includes' : INCLUDES,
> 'excludes' : EXCLUDES,
> 'dll_excludes' : DLL_EXCLUDES }
> } ,
> console = [ { 'script' : name,
> 'icon_resources' : ICON_RESOURSES,
> 'other_resources' : OTHER_RESOURCES, } ] ,
> description = 'Hele mooie',
> author = 'Tom van der Hoeven',
> author_email = 'To...@va...' ,
> maintainer = 'Tom van der Hoeven',
> maintainer_email = 'To...@va...',
> license = '',
> url = 'http://projecthomepage.com',
> data_files = DATA_FILES,
> )
> -------------------------
> can you help me
>
> Tom
>
> ------------------------------------------------------------------------------
> The modern datacenter depends on network connectivity to access resources
> and provide services. The best practices for maximizing a physical server's
> connectivity to a physical network are well understood - see how these
> rules translate into the virtual world?
> http://p.sf.net/sfu/oracle-sfdevnlfb
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Jae-Joon L. <lee...@gm...> - 2011-02-06 11:18:58
|
For an interactive use, you may use callbacks to update the visibility
of ticks automatically.
Regards,
-JJ
import matplotlib.transforms as mtransforms
def update_yticks(ax):
axis = ax.yaxis
interval = axis.get_view_interval()
# get visible ticks
myticks = [t for t in axis.iter_ticks() \
if mtransforms.interval_contains(interval, t[1])]
# make all ticks visible again
for mytick in myticks: mytick[0].label1.set_visible(True)
# make first tick invisible
myticks[0][0].label1.set_visible(False)
# make last tick invisible
myticks[-1][0].label1.set_visible(False)
import matplotlib.pyplot as plt
ax = plt.subplot(111)
update_yticks(ax)
cid = ax.callbacks.connect('ylim_changed', update_yticks)
On Sun, Feb 6, 2011 at 5:17 PM, Paul Ivanov <piv...@gm...> wrote:
> Francesco Montesano, on 2011-02-04 17:01, wrote:
>> Dear all again,
>>
>> I've tried to play with it again, but I couldn't find a
>> solution for the problem. For clarity I report an example of
>> what each of the subplots looks like:
>
> Hi Francesco,
>
> thanks for the clarification, here are two ways to get the look
> you want. I added some comments to help you understand what was
> going on before. (The resulting figure is attached, just in case).
>
> import numpy as np
> import matplotlib.pyplot as plt
> mean=np.array([-0.9206394, -0.90127456, -0.91983625, -0.97765539, -1.02991184,
> -1.02267017, -0.97730167, -0.93715172, -0.94324653, -0.92884379])
> stddev= np.array([0.16351397,0.15075966,0.13413909,0.15404823,0.13559582, 0.13109754,0.12128598,0.11589682,0.11921571,0.10866761])
>
> ax = plt.figure().add_axes([0.1,0.1,0.8,0.8])
> ax.errorbar(np.arange(10,20)/100., mean, yerr=stddev)
>
> ax.set_xlim([0.095, 0.195])
>
> lab = ax.get_ymajorticklabels()
> plt.draw() # ticks only get text assigned during a call to draw
> print lab
> for i in lab:
> print i # note that \u2212 is a unicode minus sign
>
> # this work for the first draw - relies on l.get_text() returning
> # nothing for labels which aren't used/drawn - which isn't the
> # case in general after panning and zooming interactively
> shown_lab = [l for l in lab if l.get_text()]
> shown_lab[0].set_visible(False)
> shown_lab[-1].set_visible(False)
>
> ## alternative solution without extra draw(). more robust, can be
> ## used even after initial draw.
> #ymin,ymax = ax.get_ylim()
> #tl = ax.yaxis.get_majorticklocs()
> #lab[(tl<ymin).sum()].set_visible(False)
> #lab[-(tl>ymax).sum()-1].set_visible(False)
>
> ## hybrid of the two.
> #ymin,ymax = ax.get_ylim()
> #tl = ax.yaxis.get_majorticklocs()
> #shown_lab = [l for l,t in zip(lab,tl) if t>ymin and t<ymax)
> #shown_lab[0].set_visible(False)
> #shown_lab[-1].set_visible(False)
>
> plt.show()
>
>
> best,
> --
> Paul Ivanov
> 314 address only used for lists, off-list direct email at:
> http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk1OWQMACgkQe+cmRQ8+KPekfgCfcY+R1vb2i/l/AoVsFZwsyqCC
> ihoAn1uni4kEu4Kq+B0IdCu26Kw1aA9Q
> =B6ZO
> -----END PGP SIGNATURE-----
>
> ------------------------------------------------------------------------------
> The modern datacenter depends on network connectivity to access resources
> and provide services. The best practices for maximizing a physical server's
> connectivity to a physical network are well understood - see how these
> rules translate into the virtual world?
> http://p.sf.net/sfu/oracle-sfdevnlfb
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
|
|
From: Tom v. d. H. <To...@va...> - 2011-02-06 10:20:31
|
Hello,
I have a simple program
---------------graf.py--------------
import matplotlib.pyplot as plt
plt.plot([1,2,3,8,0,9,1,10,5])
plt.ylabel('some numbers')
plt.show()
--------------------------------------------------
If I look to a matplotlib figures on my screen using the exe made with
py2exe I mis all the buttons but one of the navigation bar.
If I work direct with the Python interpreted they are there.
I use the current version of Pythonxy
------------ setup.py --------------
from distutils.core import setup
import py2exe
import matplotlib
name = 'graf.py'
INCLUDES = [ 'sip' , 'matplotlib.numerix.random_array'
# , 'PyQt4._qt'
, 'matplotlib.backends'
,
'matplotlib.backends.backend_qt4agg']
#['matplotlib.backends.backend_qt4agg']
EXCLUDES = []
[ '_gtkagg' , '_tkagg' , 'Tkconstants' , 'Tkinter' ,'tcl' ]
#['_tkagg' , '_ps' , '_fltkagg' , 'Tkinter' , 'Tkconstants' , '_cairo' ,
'_gtk' , 'gtkcairo' ,
# 'pydoc' , 'sqlite3' , 'bsddb' , 'curses' , 'tcl' ,
'_wxagg' , '_gtagg' , '_cocoaagg' , '_wx' ]
DLL_EXCLUDES = ['MSVCP90.dll']
ICON_RESOURSES = []
OTHER_RESOURCES = []
DATA_FILES = matplotlib.get_py2exe_datafiles()
setup(name = name,
version = '1.0',
options = { "py2exe" : { 'compressed' : 1,
'optimize' : 2,
'bundle_files' : 2,
'includes' : INCLUDES,
'excludes' : EXCLUDES,
'dll_excludes' : DLL_EXCLUDES }
} ,
console = [ { 'script' : name,
'icon_resources' : ICON_RESOURSES,
'other_resources' : OTHER_RESOURCES, } ] ,
description = 'Hele mooie',
author = 'Tom van der Hoeven',
author_email = 'To...@va...' ,
maintainer = 'Tom van der Hoeven',
maintainer_email = 'To...@va...',
license = '',
url = 'http://projecthomepage.com',
data_files = DATA_FILES,
)
-------------------------
can you help me
Tom
|
|
From: Paul I. <piv...@gm...> - 2011-02-06 08:17:29
|
Francesco Montesano, on 2011-02-04 17:01, wrote:
> Dear all again,
>
> I've tried to play with it again, but I couldn't find a
> solution for the problem. For clarity I report an example of
> what each of the subplots looks like:
Hi Francesco,
thanks for the clarification, here are two ways to get the look
you want. I added some comments to help you understand what was
going on before. (The resulting figure is attached, just in case).
import numpy as np
import matplotlib.pyplot as plt
mean=np.array([-0.9206394, -0.90127456, -0.91983625, -0.97765539, -1.02991184,
-1.02267017, -0.97730167, -0.93715172, -0.94324653, -0.92884379])
stddev= np.array([0.16351397,0.15075966,0.13413909,0.15404823,0.13559582, 0.13109754,0.12128598,0.11589682,0.11921571,0.10866761])
ax = plt.figure().add_axes([0.1,0.1,0.8,0.8])
ax.errorbar(np.arange(10,20)/100., mean, yerr=stddev)
ax.set_xlim([0.095, 0.195])
lab = ax.get_ymajorticklabels()
plt.draw() # ticks only get text assigned during a call to draw
print lab
for i in lab:
print i # note that \u2212 is a unicode minus sign
# this work for the first draw - relies on l.get_text() returning
# nothing for labels which aren't used/drawn - which isn't the
# case in general after panning and zooming interactively
shown_lab = [l for l in lab if l.get_text()]
shown_lab[0].set_visible(False)
shown_lab[-1].set_visible(False)
## alternative solution without extra draw(). more robust, can be
## used even after initial draw.
#ymin,ymax = ax.get_ylim()
#tl = ax.yaxis.get_majorticklocs()
#lab[(tl<ymin).sum()].set_visible(False)
#lab[-(tl>ymax).sum()-1].set_visible(False)
## hybrid of the two.
#ymin,ymax = ax.get_ylim()
#tl = ax.yaxis.get_majorticklocs()
#shown_lab = [l for l,t in zip(lab,tl) if t>ymin and t<ymax)
#shown_lab[0].set_visible(False)
#shown_lab[-1].set_visible(False)
plt.show()
best,
--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
|
|
From: Paul L. <pau...@ii...> - 2011-02-06 04:54:58
|
Hi all, I'm having trouble using multiple figures with mplot3d. Once each new figure is plotted, the plots from new figure is also displayed in all of the old figures. For example, once the plot for figure 2 has finished, the plot fo figure 1 is replaced by a copy of the plot for figure 2, and so on... I have included an abbreviated version of my script code. My original code uses Cython and my GluCat library, but I am fairly sure the cause of the problem lies either with mplot3d or with my Python script code. I am using openSUSE 11.2 with python-base-2.6.2-6.7.1.x86_64 python-matplotlib-1.0.1-20.1.x86_64 python-matplotlib-tk-1.0.1-20.1.x86_64 python-matplotlib-wx-1.0.1-20.1.x86_64 Best, Paul Script excerpt: ... from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt ... # Plot C curves. for i in xrange(0,C): ... # Use a new figure for each curve. fig=plt.figure(figsize=(15,12)) ax = fig.gca(projection='3d') plt.show() ... # Split the curve into M segments, each with an appropriate colour. for j in range(0,M): # Find N points forming a curve segment ... # Determine the colour of the curve segment... # Plot the curve segment using the chosen colour. alow=(abot-1 if j>0 else abot) ax.plot(x[0,alow:atop],x[1,alow:atop],x[2,alow:atop],c=rgb.tolist()) plt.draw() plt.show() |
|
From: vcgarcia <vit...@uo...> - 2011-02-06 02:14:50
|
Hey all, I try to create a .exe file using py2exe, but this error shows up when i try to run the created file .exe: Traceback (most recent call last): File "ModeloPitzer.py", line 2, in <module> File "zipextimporter.pyo", line 82, in load_module File "matplotlib\pyplot.pyo", line 95, in <module> File "matplotlib\backends\__init__.pyo", line 25, in pylab_setup File "zipextimporter.pyo", line 82, in load_module File "matplotlib\backends\backend_qt4agg.pyo", line 12, in <module> File "zipextimporter.pyo", line 82, in load_module File "matplotlib\backends\backend_qt4.pyo", line 16, in <module> File "zipextimporter.pyo", line 82, in load_module File "matplotlib\backends\qt4_editor\figureoptions.pyo", line 11, in <module> File "zipextimporter.pyo", line 82, in load_module File "matplotlib\backends\qt4_editor\formlayout.pyo", line 51, in <module> ImportError: Warning: formlayout requires PyQt4 >v4.3 My PyQt4 version is 4.5.4. How can I solve that? Anyone? -- View this message in context: http://old.nabble.com/Warning%3A-formlayout-requires-PyQt4-%3Ev4.3-tp30838433p30838433.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Eric F. <ef...@ha...> - 2011-02-05 21:02:22
|
On 02/04/2011 02:03 PM, Christoph Gohlke wrote: [...] > > How about these changes to color.py (attached). This avoids copies, uses > in-place operations, and calculates single precision when normalizing > small integer and float32 arrays. Similar could be done for LogNorm. Do > masked arrays support in-place operations? > > Christoph Christoph, Thank you. Done (with slight modifications) in 8946 (trunk). I was surprised by the speedup in normalizing large arrays when using float32 versus float64. A factor of 10 on my machine with (1000,1000), timed with ipython %timeit. Because of the way %timeit does multiple tests, I suspect it may exaggerate cache effects. Eric |
|
From: Benjamin R. <ben...@ou...> - 2011-02-05 18:43:45
|
On Fri, Feb 4, 2011 at 6:41 PM, Benjamin Root <ben...@ou...> wrote: > On Friday, February 4, 2011, Massimo Di Stefano > <mas...@gm...> wrote: > > Hello All, > > > > > > i'm plotting a 3d colored surface using a 4D array that comes from a .mat > file > > using this code : > > > > > > import scipy.io as sio > > import pylab as p > > import mpl_toolkits.mplot3d.axes3d as p3 > > > > def loadmatfile(matfile): > > matdata = sio.loadmat(matfile) > > return matdata > > > > > > def plot3dcolor(matfile): > > data = loadmatfile(matfile) > > x = data['X_depth'] > > y = data['Y_depth'] > > z = -data['Z_depth'] > > c = data['Z_compl'] > > fig=p.figure() > > ax = p3.Axes3D(fig) > > cmap = p.get_cmap('jet') > > norm = p.Normalize(c.min(), c.max()) > > colors = cmap(norm(c)) > > ax.plot_surface(x, y, z, rstride=10, cstride=10, facecolors=colors) > > ax.set_xlabel('X') > > ax.set_ylabel('Y') > > ax.set_zlabel('Z') > > print x,y > > p.show() > > > > > > matfile = '/Users/epy/Desktop/complexity_depth_grid1.mat' > > plot3dcolor(matfile) > > > > > > > > the results is nice : > > > > http://img831.imageshack.us/f/schermata20110204a14542.png/ > > > > > > but as you can see, the mouse cursor shows me the x,y values (they are > longitude and latitude) > > but on the axis i have them starting from 0 ... > > > > how can i change the axis to display the lon-lat coordinates ? > > > > > > thanks a lot for any help! > > > > Massimo. > > > > > > I suspect what is happening is that the axes label numbers are right, > but is not showing the offset information. The display of offset data > in a 3d plot is a new feature that exists only in the development > branch. > > To confirm this, could you send me your may file (if it is small) so > that I can try out your script? > > Ben Root > Ok, so I can confirm that there are offset labels displaying when using the development version of mpl, which means that for some reason, the auto-ticker is deciding to use the offset display instead of just the regular display. Usually, this behavior doesn't trigger until 1e4 or larger, I believe? I will have to take a peek at what ticker is being used by default and seeing if it is different from the regular plots. In the meantime, if you need something to work right away, and you feel ambitious, you can fiddle with the tickers through the ax.w_xaxis and ax.w_yaxis objects (not the ax.xaxis and ax.yaxis objects): http://matplotlib.sourceforge.net/api/ticker_api.html?highlight=ticker#matplotlib-ticker Ben Root |
|
From: Jorge S. <jor...@ya...> - 2011-02-05 18:38:27
|
Jorge Scandaliaris <jorgesmbox-ml@...> writes: < snip > > > The symptoms are that > the interaction (keys and mouse clicks) works OK as long as I don't resize the > window. Once I do this, the interaction is gone. What happens when the window > is > resized, that could be related to what I experience. > > OK, lets see if I can come up with a simple code reproducing this... > I couldn't come up with a simple example showing the problem. My attempts so far ended in working examples. I did find a change in my code that triggers the problem: My code uses a modified version of the lasso_demo example, contains two axes, where I draw an image with imshow and a collection of circles with scatter. Originally scatter was called with a fixed size for all points, and I just changed it so each points gets a different size. Just don't ask me why this seemingly innocent change affects (breaks) the event handling. I hope somebody can give me some hints. I'll keep checking the code to see if I find anything suspicious. jorges |
|
From: Charles R. <cha...@gm...> - 2011-02-05 09:51:17
|
Dear all,
I want to generate a pdf with some text and graphics. Since I use
matplotlib to make plot through the graphical user interface, I want to
embed these graphs directly into a cairo (or pangocairo) instance.
But I cannot manage.
I send a small example. If you can help me....
import cairo
import pango
import pangocairo
import matplotlib
matplotlib.use('Cairo')
from matplotlib import pyplot
surface = cairo.PDFSurface('test_report.pdf', 595, 795)
context = pangocairo.CairoContext(cairo.Context(surface))
context.translate(0, 50)
layout = context.create_layout()
layout.set_text('Hello, this is a long text to see if the lines are
automatically broken.')
layout.set_font_description(pango.FontDescription("Sans Bold 12"))
layout.set_width(pango.SCALE * 570)
# Put the text in the context.
context.set_source_rgb(0, 0, 0)
context.show_layout(layout)
figure = pyplot.figure()
axe = figure.add_subplot(111)
toto = axe.plot(range(20),[i**2 for i in range(20)])
context.set_source(figure.canvas)
Thanks a lot.
|
|
From: Benjamin R. <ben...@ou...> - 2011-02-05 00:41:23
|
On Friday, February 4, 2011, Massimo Di Stefano <mas...@gm...> wrote: > Hello All, > > > i'm plotting a 3d colored surface using a 4D array that comes from a .mat file > using this code : > > > import scipy.io as sio > import pylab as p > import mpl_toolkits.mplot3d.axes3d as p3 > > def loadmatfile(matfile): > matdata = sio.loadmat(matfile) > return matdata > > > def plot3dcolor(matfile): > data = loadmatfile(matfile) > x = data['X_depth'] > y = data['Y_depth'] > z = -data['Z_depth'] > c = data['Z_compl'] > fig=p.figure() > ax = p3.Axes3D(fig) > cmap = p.get_cmap('jet') > norm = p.Normalize(c.min(), c.max()) > colors = cmap(norm(c)) > ax.plot_surface(x, y, z, rstride=10, cstride=10, facecolors=colors) > ax.set_xlabel('X') > ax.set_ylabel('Y') > ax.set_zlabel('Z') > print x,y > p.show() > > > matfile = '/Users/epy/Desktop/complexity_depth_grid1.mat' > plot3dcolor(matfile) > > > > the results is nice : > > http://img831.imageshack.us/f/schermata20110204a14542.png/ > > > but as you can see, the mouse cursor shows me the x,y values (they are longitude and latitude) > but on the axis i have them starting from 0 ... > > how can i change the axis to display the lon-lat coordinates ? > > > thanks a lot for any help! > > Massimo. > > I suspect what is happening is that the axes label numbers are right, but is not showing the offset information. The display of offset data in a 3d plot is a new feature that exists only in the development branch. To confirm this, could you send me your may file (if it is small) so that I can try out your script? Ben Root |
|
From: Jorge S. <jor...@ya...> - 2011-02-05 00:30:22
|
Hi, I have some code that's been working for a long time, but it's behaving strange with current (svn) matplotlib. It's too large to post here, so I will try to come up with a minimal version reproducing the problem. Meanwhile, I wanted to ask if anyone would have a clue of what could be going on. The symptoms are that the interaction (keys and mouse clicks) works OK as long as I don't resize the window. Once I do this, the interaction is gone. What happens when the window is resized, that could be related to what I experience. OK, lets see if I can come up with a simple code reproducing this... jorges |
|
From: Massimo Di S. <mas...@gm...> - 2011-02-05 00:14:19
|
Hello All, i'm plotting a 3d colored surface using a 4D array that comes from a .mat file using this code : import scipy.io as sio import pylab as p import mpl_toolkits.mplot3d.axes3d as p3 def loadmatfile(matfile): matdata = sio.loadmat(matfile) return matdata def plot3dcolor(matfile): data = loadmatfile(matfile) x = data['X_depth'] y = data['Y_depth'] z = -data['Z_depth'] c = data['Z_compl'] fig=p.figure() ax = p3.Axes3D(fig) cmap = p.get_cmap('jet') norm = p.Normalize(c.min(), c.max()) colors = cmap(norm(c)) ax.plot_surface(x, y, z, rstride=10, cstride=10, facecolors=colors) ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') print x,y p.show() matfile = '/Users/epy/Desktop/complexity_depth_grid1.mat' plot3dcolor(matfile) the results is nice : http://img831.imageshack.us/f/schermata20110204a14542.png/ but as you can see, the mouse cursor shows me the x,y values (they are longitude and latitude) but on the axis i have them starting from 0 ... how can i change the axis to display the lon-lat coordinates ? thanks a lot for any help! Massimo. |
|
From: Christoph G. <cg...@uc...> - 2011-02-05 00:04:06
|
On 2/4/2011 3:29 PM, Eric Firing wrote:
> On 02/04/2011 12:33 PM, Christoph Gohlke wrote:
>>
>>
>> On 2/4/2011 2:14 PM, Eric Firing wrote:
>>> On 02/04/2011 11:33 AM, Eric Firing wrote:
>>>> On 02/04/2011 10:28 AM, Christoph Gohlke wrote:
>>>>>
>>>>>
>>>>> On 2/4/2011 11:54 AM, Eric Firing wrote:
>>>>>> On 02/03/2011 05:35 PM, Christoph Gohlke wrote:
>>>>>>>
>>>>>>>
>>>>>>> On 2/3/2011 6:50 PM, Eric Firing wrote:
>>>>>>>> On 02/03/2011 03:04 PM, Benjamin Root wrote:
>>>>>>>>
>>>>>>>>> Also, not to sound too annoying, but has anyone considered the idea of
>>>>>>>>> using compressed arrays for holding those rgba values?
>>>>>>>>
>>>>>>>> I don't see how that really helps; as far as I know, a full rgba array
>>>>>>>> has to be passed into agg. What *does* help is using uint8 from start
>>>>>>>> to finish. It might also be possible to use some smart downsampling
>>>>>>>> before generating the rgba array, but the uint8 route seems to me the
>>>>>>>> first thing to attack.
>>>>>>>>
>>>>>>>> Eric
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Ben Root
>>>>>>>>
>>>>>>>
>>>>>>> Please review the attached patch. It avoids generating and storing
>>>>>>> float64 rgba arrays and uses uint8 rgba instead. That's a huge memory
>>>>>>> saving and also faster. I can't see any side effects as
>>>>>>> _image.fromarray() converts the float64 input to uint8 anyway.
>>>>>>
>>>>>> Christoph,
>>>>>>
>>>>>> Thank you! I haven't found anything wrong with that delightfully simple
>>>>>> patch, so I have committed it to the trunk. Back in 2007 I added the
>>>>>> ability of colormapping to generate uint8 directly, precisely to enable
>>>>>> this sort of optimization. Why it was not already being used in imshow,
>>>>>> I don't know--maybe I was going to do it, got sidetracked, and never
>>>>>> finished.
>>>>>>
>>>>>> I suspect it won't be as simple as for the plain image, but there may be
>>>>>> opportunities for optimizing with uint8 in other image-like operations.
>>>>>>
>>>>>>>
>>>>>>> So far other attempts to optimize memory usage were thwarted by
>>>>>>> matplotlib's internal use of masked arrays. As mentioned before, users
>>>>>>> can provide their own normalized rgba arrays to avoid all this processing.
>>>>>>>
>>>>>>
>>>>>> Did you see other potential low-hanging fruit that might be harvested
>>>>>> with some changes to the code associated with masked arrays?
>>>>>>
>>>>>> Eric
>>>>>>
>>>>>
>>>>> The norm function currently converts the data to double precision
>>>>> floating point and also creates temporary arrays that can be avoided.
>>>>> For float32 and low precision integer images this seems overkill and one
>>>>> could use float32. It might be possible to replace the norm function
>>>>> with numpy.digitize if that works with masked arrays. Last, the
>>>>> _image.frombyte function does a copy of 'strided arrays' (only relevant
>>>>> when zooming/panning large images). I try to provide a patch for each.
>>>>
>>>> masked arrays can be filled to create an ndarray before passing to
>>>> digitize; whether that will be faster, remains to be seen. I've never
>>>> used digitize.
>>>
>>> I didn't say that ("can be filled...") right. I think one would need to
>>> use the mask to put in the i_bad index where appropriate. np.ma does
>>> not have a digitize function. I suspect it won't help much if at all in
>>> Normalize, but it would be a natural for use in BoundaryNorm.
>>>
>>> It looks easy to allow Normalize.__call__ to use float32 if that is what
>>> it receives.
>>>
>>> I don't see any unnecessary temporary array creation apart from the
>>> conversion to float64, except for the generation of a masked array
>>> regardless of input. I don't think this costs much; if it gets an
>>> ndarray it does not copy it, and it does not generate a full mask array.
>>> Still, the function probably could be sped up a bit by handling
>>> masking more explicitly instead of letting ma do the work.
>>>
>>
>> In class Normalize:
>> result = 0.0 * val
>> and
>> result = (val-vmin) / (vmax-vmin)
>>
>>> Eric
>>>
>>>>
>>>> Regarding frombyte, I suspect you can't avoid the copy; the data
>>>> structure being passed to agg is just a string of bytes, as far as I can
>>>> see, so everything is based on having a simple contiguous array.
>>>>
>>
>> The PyArray_ContiguousFromObject call will return a copy if the input
>> array is not already contiguous.
>
> Exactly. I thought you were suggesting that this was not needed, but
> maybe I misunderstood.
>
> Eric
In fact I am suggesting that this is not needed. The copy-to-agg routine
could be made 'stride aware' and use PyArray_FromObject. Not a very low
hanging fruit but it seems fromarray() does this already. I'm not sure
it's worth.
How about these changes to color.py (attached). This avoids copies, uses
in-place operations, and calculates single precision when normalizing
small integer and float32 arrays. Similar could be done for LogNorm. Do
masked arrays support in-place operations?
Christoph
|