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


Showing 18 results of 18

From: Eric F. <ef...@ha...> - 2011年03月08日 22:19:44
On 03/08/2011 09:53 AM, Mark Bakker wrote:
> Works great Eric.
> Is this in the documentation somewhere?
Probably only in the change notes and in the docstrings.
http://matplotlib.sourceforge.net/_static/CHANGELOG
Eric
> Thanks,
> Mark
>
>
> From: Eric Firing <ef...@ha... <mailto:ef...@ha...>>
> On 03/07/2011 11:51 AM, Mark Bakker wrote:
> > My values on the vertical axis are large, but the range is small:
> > plot([3004,3005,3006])
> > By default this plots 0,1,2 as tickmarks along the vertical axis, and
> > then at the top of the vertical axis is prints "+3.005e3".
> > I prefer to simply get 3004,3005,3006 at the tickmarks.
>
> If you are using a recent mpl, try following your plot command with
>
> ticklabel_format(useOffset=False)
>
> Eric
>
>
>
> ------------------------------------------------------------------------------
> What You Don't Know About Data Connectivity CAN Hurt You
> This paper provides an overview of data connectivity, details
> its effect on application quality, and explores various alternative
> solutions. http://p.sf.net/sfu/progress-d2d
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Kornél J. <kja...@gm...> - 2011年03月08日 21:23:04
Hi!
I would greatly appreciate if you could give me some advice.
I would like to make a Cartesian axes with a polar grid shown, just as here
in this example:
http://matplotlib.sourceforge.net/examples/axes_grid/demo_curvelinear_grid.html
I have studied this example, I don't even need ParasiteAxes, just to make
those polar grid lines visible.
However, I would like to control the placement and size of such an axis and
axisartist.SubplotHost or Subplot don't
seem to give me enough control. I want subplots of unequal sizes, like in
the GridSpec examples.
Normally, one can easily add axes with fixed position and sizes with the
convenience method
fig.add_axes() by specifying a "rect" list. How could I control the
placement of such axisartist axes
similarly?
Thank you in advance.
Kornel
From: Goyo <goy...@gm...> - 2011年03月08日 21:12:34
2011年3月8日 Paul Anton Letnes <pau...@gm...>:
> Hi!
>
> This simple loop:
>>>> import time
>>>> import pylab
>>>> for i in range(100):
> ...   time.sleep(0.1)
> ...   pylab.figure()
> ...
> will have python use more and more memory. While this is not technically a memory leak, it becomes one in practice, if I want to create a large number of figure objects. How can I free the memory used by one or all figure objects?
Your code creating many objects is not a memory leak. You can reuse
figures or dispose of them calling pylab.close(). See docstrings for
pylab.close and pylab.clf.
Goyo
From: Paul A. L. <pau...@gm...> - 2011年03月08日 20:44:51
Hi!
This simple loop:
>>> import time
>>> import pylab
>>> for i in range(100):
... time.sleep(0.1)
... pylab.figure()
... 
will have python use more and more memory. While this is not technically a memory leak, it becomes one in practice, if I want to create a large number of figure objects. How can I free the memory used by one or all figure objects?
Cheers
Paul
From: Mark B. <ma...@gm...> - 2011年03月08日 19:53:49
Works great Eric.
Is this in the documentation somewhere?
Thanks,
Mark
From: Eric Firing <ef...@ha...>
> On 03/07/2011 11:51 AM, Mark Bakker wrote:
> > My values on the vertical axis are large, but the range is small:
> > plot([3004,3005,3006])
> > By default this plots 0,1,2 as tickmarks along the vertical axis, and
> > then at the top of the vertical axis is prints "+3.005e3".
> > I prefer to simply get 3004,3005,3006 at the tickmarks.
>
> If you are using a recent mpl, try following your plot command with
>
> ticklabel_format(useOffset=False)
>
> Eric
>
From: Jouni K. S. <jk...@ik...> - 2011年03月08日 19:05:37
Pål Gunnar Ellingsen <pa...@gm...> writes:
> I know there was a post on the mail liste a couple of days ago ( Bug
> in `dviread.py'), but I'm not sure if this is the same error, which it
> shouldn't be as I'm using the latest svn revision.
Not the same error - it is showing a warning message generated by the
workaround to that problem. It looks like your pdftex.map file is
lacking an entry for cmr12, which doesn't make any sense. I installed
TeX Live 2010 on my Mac, and I don't see this problem. Can you send me
your pdftex.map file off-list? It seems to be at
/usr/share/texlive/texmf-var/fonts/map/pdftex/updmap/pdftex.map
on your system.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Benjamin R. <ben...@ou...> - 2011年03月08日 19:04:21
On Tue, Mar 8, 2011 at 12:05 PM, Pål Gunnar Ellingsen <pa...@gm...>wrote:
> Hi
>
> I'm trying to make a plot as a pdf file (or any vector format) with LaTeX fonts. I can make it output the file using show, but not with savefig (unless it is raster graphics).
>
>
> My setup is Fedora 13 64 bit with the latest TexLive: texlive-2011-0.1.20110227.fc13.x86_64
> and matplotlib from svn, revision 8988.
>
> I can run tex_demo.py as it is from http://matplotlib.sourceforge.net/users/usetex.html
>
>
> but is I change it such that instead of a png it outputs a pdf, like the example below, it crashes.
> I know there was a post on the mail liste a couple of days ago ( Bug in `dviread.py'), but I'm not sure if this is the same error, which it shouldn't be as I'm using the latest svn revision.
>
>
> Does anyone have the same problem?
>
> The example and debug output are shown below.
>
> Regards
>
> Pål
>
> Actually, I think this is the same problem as that in "Bug in
`dviread.py'". The problem is that that bug was probably fixed shortly
after our transition to github.com, so the svn version actually isn't the
latest version of the code. Please see the documentation here (note, this
documentation is still unofficial, but it should get you started):
http://matplotlib.github.com/faq/installing_faq.html#install-from-git
I hope that helps!
Ben Root
From: Andrew C. <ach...@es...> - 2011年03月08日 18:21:21
Hello,
I am trying to plot elevation data, and I am looking for recommendation on visualization of the data?
My main concern is that the data I am extracting my elevation data from is coarse and there the line graphs I am producing look jagged. Is there a way to smooth the data also?
Thank you
Andrew
From: Pål G. E. <pa...@gm...> - 2011年03月08日 18:05:59
Hi
I'm trying to make a plot as a pdf file (or any vector format) with
LaTeX fonts. I can make it output the file using show, but not with
savefig (unless it is raster graphics).
My setup is Fedora 13 64 bit with the latest TexLive:
texlive-2011-0.1.20110227.fc13.x86_64
and matplotlib from svn, revision 8988.
I can run tex_demo.py as it is from
http://matplotlib.sourceforge.net/users/usetex.html
but is I change it such that instead of a png it outputs a pdf, like
the example below, it crashes.
I know there was a post on the mail liste a couple of days ago ( Bug
in `dviread.py'), but I'm not sure if this is the same error, which it
shouldn't be as I'm using the latest svn revision.
Does anyone have the same problem?
The example and debug output are shown below.
Regards
Pål
Example (test.py):
---------------------------
#!/usr/bin/env python
import matplotlib
matplotlib.use('Qt4Agg')
from matplotlib import rc
from numpy import arange, cos, pi
from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \
 grid, savefig, show
rc('text', usetex=True)
rc('font', family='serif')
figure(1, figsize=(6,4))
ax = axes([0.1, 0.1, 0.8, 0.7])
t = arange(0.0, 1.0+0.01, 0.01)
s = cos(2*2*pi*t)+2
plot(t, s)
xlabel(r'\textbf{time (s)}')
ylabel(r'\textit{voltage (mV)}',fontsize=16)
title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!",
 fontsize=16, color='r')
grid(True)
savefig('tex_demo.pdf')
show()
--------------------------
Debug output
------
python test.py --verbose-debug-annoying :
$HOME=/home/gudrun/foo_bar
CONFIGDIR=/home/gudrun/foo_bar/.matplotlib
matplotlib data path /export/work/foo_bar/matplotlib/lib/matplotlib/mpl-data
loaded rc file /export/work/foo_bar/matplotlib/lib/matplotlib/mpl-data/matplotlibrc
matplotlib version 1.1.0svn
verbose.level debug-annoying
interactive is False
units is False
platform is linux2
loaded modules: ['numpy.lib._iotools', 'xml.sax.urlparse',
'distutils', '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.operator', 'numpy.ma.cPickle',
'struct', 'numpy.random.info', 'tempfile', 'base64', 'numpy.linalg',
'matplotlib.threading', 'numpy.testing.operator', 'imp',
'numpy.testing', 'collections', 'numpy.core.umath', 'distutils.types',
'numpy.lib.numpy', 'numpy.core.scalarmath', 'functools', 'zipimport',
'string', 'matplotlib.subprocess', 'numpy.testing.os',
'matplotlib.locale', 'numpy.lib.arraysetops',
'numpy.testing.unittest', 'numpy.lib.math', 'encodings.utf_8',
'matplotlib.__future__', 'zope', 'numpy.testing.re', 'itertools',
'numpy.version', 'numpy.lib.re', 'distutils.re', 'ctypes.os',
'numpy.core.os', 'numpy.lib.type_check', 'httplib',
'numpy.lib.__builtin__', 'signal', 'numpy.lib.types',
'numpy.lib._datasource', 'random', 'numpy.ma.extras', 'token',
'numpy.fft.fftpack_lite', 'matplotlib.cbook', 'ctypes.ctypes',
'xml.sax.xmlreader', 'numpy.__builtin__', 'dis', 'distutils.version',
'cStringIO', 'numpy.ma.core', 'numpy.numpy', 'matplotlib.StringIO',
'locale', 'numpy.add_newdocs', 'numpy.lib.getlimits',
'matplotlib.urllib2', 'syslog', 'xml.sax.saxutils',
'matplotlib.numpy', 'numpy.lib.sys', 'encodings',
'numpy.ma.itertools', 'StringIO', 'numpy.lib.io', 'abc',
'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', 'inspect', 'numpy.ma.inspect', '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', 'paste', '_functools', '_locale',
'matplotlib.sre_constants', 'socket', 'thread', 'numpy.lib.ufunclike',
'numpy.core.memmap', 'traceback', 'numpy.core._dotblas', 'weakref',
'numpy.core._internal', 'numpy.fft.fftpack', 'opcode',
'numpy.linalg.lapack_lite', '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', 'matplotlib.re', 'numpy.core.cPickle',
'operator', 'array', '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.ma', 'xml.sax.handler', 'os.path',
'tokenize', 'numpy.lib.stride_tricks', 'numpy.core.numpy', 'numpy',
'_warnings', 'matplotlib.types', 'numpy.core.defmatrix', 'xml.sax.os',
'cPickle', 'encodings.__builtin__', 'matplotlib.xml',
'matplotlib.new', '_codecs', 'numpy.lib.operator', 'numpy.__config__',
'_collections', 'matplotlib.pyparsing', '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.random',
'posix', 'encodings.aliases', 'matplotlib.fontconfig_pattern',
'fnmatch', 'sre_parse', 'abrt_exception_handler', 'pickle',
'numpy.core.ctypes', 'mimetools', 'distutils.distutils', 'copy_reg',
'sre_compile', 'xml.sax', '_hashlib', '_random',
'numpy.lib.__future__', 'site', 'numpy.lib.polynomial',
'numpy._import_tools', '__main__', 'numpy.fft.info',
'numpy.core.records', 'shutil', 'numpy.lib.cPickle', 'numpy.sys',
'matplotlib.weakref', 'xml.sax.urllib', 'matplotlib.os',
'numpy.testing.traceback', 'strop', 'numpy.testing.numpytest',
'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', 'warnings', 'numpy.lib.utils',
'numpy.core.defchararray', '_ctypes', 'numpy.lib.shape_base',
'numpy.core.types', 'textwrap', 'sys', 'numpy.core.warnings',
'numpy.core.__builtin__', 'xml.sax.sys', 'numpy.lib.format',
'numpy.lib.os', 'numpy.testing.nosetester', 'types',
'numpy.lib.shutil', 'ssl', 'matplotlib.distutils', '_weakref',
'distutils.errors', 'urlparse', 'linecache', 'matplotlib.shutil',
'numpy.lib.cStringIO', 'time', 'numpy.lib.machar',
'numpy.linalg.linalg', 'numpy.testing.utils']
Using fontManager instance from /home/gudrun/foo_bar/.matplotlib/fontList.cache
backend Qt4Agg version 0.9.1
Dvi: /home/gudrun/foo_bar/.matplotlib/tex.cache/03e7a0bce05f84219ebbd9b25349b054.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
find_tex_file(pncr7t.tfm): ['kpsewhich', 'pncr7t.tfm']
find_tex_file result:
/usr/share/texlive/texmf-dist/fonts/tfm/adobe/ncntrsbk/pncr7t.tfm
opening tfm file
/usr/share/texlive/texmf-dist/fonts/tfm/adobe/ncntrsbk/pncr7t.tfm
lh=18, bc=0, ec=170, nw=33, nh=16, nd=16
find_tex_file(pncr7t.vf): ['kpsewhich', 'pncr7t.vf']
find_tex_file result:
/usr/share/texlive/texmf-dist/fonts/vf/adobe/ncntrsbk/pncr7t.vf
Dvi: /usr/share/texlive/texmf-dist/fonts/vf/adobe/ncntrsbk/pncr7t.vf
find_tex_file(pncr8r.tfm): ['kpsewhich', 'pncr8r.tfm']
find_tex_file result:
/usr/share/texlive/texmf-dist/fonts/tfm/adobe/ncntrsbk/pncr8r.tfm
opening tfm file
/usr/share/texlive/texmf-dist/fonts/tfm/adobe/ncntrsbk/pncr8r.tfm
lh=18, bc=1, ec=255, nw=38, nh=16, nd=16
find_tex_file(pncr8r.vf): ['kpsewhich', 'pncr8r.vf']
find_tex_file result:
Dvi._xxx: encountered special: Warning: missing glyph `Gamma'
Dvi._xxx: encountered special: Warning: missing glyph `Delta'
Dvi._xxx: encountered special: Warning: missing glyph `Theta'
Dvi._xxx: encountered special: Warning: missing glyph `Lambda'
Dvi._xxx: encountered special: Warning: missing glyph `Xi'
Dvi._xxx: encountered special: Warning: missing glyph `Pi'
Dvi._xxx: encountered special: Warning: missing glyph `Sigma'
Dvi._xxx: encountered special: Warning: missing glyph `Upsilon'
Dvi._xxx: encountered special: Warning: missing glyph `Phi'
Dvi._xxx: encountered special: Warning: missing glyph `Psi'
Dvi._xxx: encountered special: Warning: missing glyph `Omega'
Dvi._xxx: encountered special: Warning: missing glyph `dotlessj'
Dvi._xxx: encountered special: Warning: missing glyph `lslashslash'
Dvi: /home/gudrun/foo_bar/.matplotlib/tex.cache/3751fe08829ac873c509bb548895020f.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
find_tex_file(cmr12.tfm): ['kpsewhich', 'cmr12.tfm']
find_tex_file result:
/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm
opening tfm file /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm
lh=18, bc=0, ec=127, nw=34, nh=16, nd=10
find_tex_file(cmr12.vf): ['kpsewhich', 'cmr12.vf']
find_tex_file result:
find_tex_file(cmmi12.tfm): ['kpsewhich', 'cmmi12.tfm']
find_tex_file result:
/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm
opening tfm file /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm
lh=18, bc=0, ec=127, nw=97, nh=15, nd=9
find_tex_file(cmmi12.vf): ['kpsewhich', 'cmmi12.vf']
find_tex_file result:
Dvi: /home/gudrun/foo_bar/.matplotlib/tex.cache/3751fe08829ac873c509bb548895020f.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
Assigning font /F1 = cmr12
find_tex_file(pdftex.map): ['kpsewhich', 'pdftex.map']
find_tex_file result:
/usr/share/texlive/texmf-var/fonts/map/pdftex/updmap/pdftex.map
Multiple encodings for pbkdo8y = URWBookmanL-DemiBold, skipping
Traceback (most recent call last):
 File "test", line 35, in <module>
 savefig('tex_demo.pdf')
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/pyplot.py",
line 363, in savefig
 return fig.savefig(*args, **kwargs)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/figure.py",
line 1159, in savefig
 self.canvas.print_figure(*args, **kwargs)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/backends/backend_qt4agg.py",
line 153, in print_figure
 FigureCanvasAgg.print_figure(self, *args, **kwargs)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/backend_bases.py",
line 1963, in print_figure
 **kwargs)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/backend_bases.py",
line 1737, in print_pdf
 return pdf.print_pdf(*args, **kwargs)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/backends/backend_pdf.py",
line 2183, in print_pdf
 self.figure.draw(renderer)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/artist.py",
line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/figure.py",
line 873, in draw
 func(*args)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/artist.py",
line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/axes.py", line
1954, in draw
 a.draw(renderer)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/artist.py",
line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/axis.py", line
986, in draw
 tick.draw(renderer)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/artist.py",
line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/axis.py", line
234, in draw
 self.label1.draw(renderer)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/artist.py",
line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/text.py", line
571, in draw
 self._fontproperties, angle)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/backends/backend_pdf.py",
line 1576, in draw_tex
 psfont = self.tex_font_mapping(dvifont.texname)
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/backends/backend_pdf.py",
line 1366, in tex_font_mapping
 return self.tex_font_map[texfont]
 File "/export/work/foo_bar/matplotlib/lib/matplotlib/dviread.py",
line 673, in __getitem__
 result = self._font[texname]
KeyError: 'cmr12'
From: Benjamin R. <ben...@ou...> - 2011年03月08日 16:16:02
On Tue, Mar 8, 2011 at 4:51 AM, Andrea Crotti <and...@gm...>wrote:
> Goyo <goy...@gm...> writes:
>
> >
> > As Ben explained you need to draw first. So the usual path is:
> > 1. Draw
> > 2. Figure out the size of potentially problematic things (labels,
> > titles...) and the space you need.
> > 3. Adjust subplots or whatever needs adjustment to fit.
> > 4. Draw again.
> >
> > Sort of weird but it works and I think it's widely used.
> >
> > Goyo
>
> Sorry if I'm annoying, but is there any example about that?
> For the text I didn't find anything using bbox_patch to compute the size
> and then adapt the size of it, unless I'm blind maybe it would be nice
> to add in the website for the future...
>
>
There is an example for doing something similar, but for tick labels.
Hopefully this might be a good demonstration of the concept:
http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels
Seeing this code just reminds me just how messy it is to deal with
auto-layouts...
> And also if I create an object of type matplotlib.Text.text how do I
> actually attach it to my current figure?
>
>
Because a Text object is derived from Artist, I believe you can use
add_artist() to attach your Text object to an axes object (I haven't tried
this personally).
Ben Root
From: Mike K. <mc...@gm...> - 2011年03月08日 12:36:20
Is there an easy way to draw a piece of text (or whatever) to an 
off-screen or off-canvas buffer, figure out the size from that, and then 
use that to draw to the plot?
M
On 3/8/11 5:51 AM, Andrea Crotti wrote:
> Goyo<goy...@gm...> writes:
>
>>
>> As Ben explained you need to draw first. So the usual path is:
>> 1. Draw
>> 2. Figure out the size of potentially problematic things (labels,
>> titles...) and the space you need.
>> 3. Adjust subplots or whatever needs adjustment to fit.
>> 4. Draw again.
>>
>> Sort of weird but it works and I think it's widely used.
>>
>> Goyo
>
> Sorry if I'm annoying, but is there any example about that?
> For the text I didn't find anything using bbox_patch to compute the size
> and then adapt the size of it, unless I'm blind maybe it would be nice
> to add in the website for the future...
>
> And also if I create an object of type matplotlib.Text.text how do I
> actually attach it to my current figure?
>
> Thanks,
> Andrea
>
> ------------------------------------------------------------------------------
> What You Don't Know About Data Connectivity CAN Hurt You
> This paper provides an overview of data connectivity, details
> its effect on application quality, and explores various alternative
> solutions. http://p.sf.net/sfu/progress-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jae-Joon L. <lee...@gm...> - 2011年03月08日 12:31:55
With current master at git repo, I cannot reproduce this.
Both test_1.eps and test_2.eps are ~4M in size.
Can you check if the file size varies significantly with rc parameters
ps.usedistiller?
I'm not sure how text setting can affect the images.
Regards,
-JJ
On Tue, Mar 1, 2011 at 7:23 AM, Thomas Robitaille
<tho...@gm...> wrote:
> Hi,
>
> In the following example:
>
> ---
>
> import numpy as np
>
> import matplotlib as mpl
> mpl.use('Agg')
> import matplotlib.pyplot as plt
>
> fig = plt.figure()
> ax = fig.add_subplot(1, 1, 1)
> ax.imshow(np.random.random((1024, 1024)), interpolation='nearest')
> fig.savefig('test_1.eps')
>
> mpl.rc('text', usetex=True)
>
> fig = plt.figure()
> ax = fig.add_subplot(1, 1, 1)
> ax.imshow(np.random.random((1024, 1024)), interpolation='nearest')
> fig.savefig('test_2.eps')
>
> ---
>
> the file test_2.eps is almost 6 times larger than test_1.eps, and takes much longer to draw. It looks like in the first case, the image is rendered as a bitmap (the way it should be), whereas in the second case each pixel is drawn individually as a polygon. Is this a bug?
>
> I am using r8988 of matplotlib.
>
> Thanks for any help!
>
> Thomas
> ------------------------------------------------------------------------------
> Free Software Download: Index, Search & Analyze Logs and other IT data in
> Real-Time with Splunk. Collect, index and harness all the fast moving IT data
> generated by your applications, servers and devices whether physical, virtual
> or in the cloud. Deliver compliance at lower cost and gain new business
> insights. http://p.sf.net/sfu/splunk-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2011年03月08日 12:21:30
The easiest would be using a masked array.
arr = np.arange(100).reshape((10,10))
iny, inx = np.indices(arr.shape)
mymask=inx+iny>=10
imshow(np.ma.array(arr, mask=mymask), cmap="gray")
imshow(np.ma.array(arr, mask=~mymask), cmap="jet")
However, I recommend you to use the clippath.
http://matplotlib.sourceforge.net/examples/api/clippath_demo.html
Regards,
-JJ
On Tue, Mar 8, 2011 at 6:46 PM, T J <tj...@gm...> wrote:
> imshow fills an entire "unit" in the grid. I'd like to overlay two
> imshow's on top of each other, but in a non-destructive manner. One
> way of doing this would be to modify the behavior of imshow so that it
> only fills a portion of each "unit" in the grid. For example, in the
> first imshow, I'd fill everything below the diagonal and in the second
> imshow, I'd fill everything above the diagonal.
>
> Would this type of modification to AxesImage be feasible? Or should I
> just (manually) make a PolyCollection for each imshow? I'd still want
> interpolations to work as expected, but where filling (or not) is
> restricted to a region within the "unit". Generally, I think this
> could be a nice addition to mpl, but if there is a more typical way of
> visualizing two imshows on the same axis, I might try that instead.
>
> thanks.
>
> ------------------------------------------------------------------------------
> What You Don't Know About Data Connectivity CAN Hurt You
> This paper provides an overview of data connectivity, details
> its effect on application quality, and explores various alternative
> solutions. http://p.sf.net/sfu/progress-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2011年03月08日 12:09:29
This is a bug and I just pushed a fix to the git repo.
Meanwhile, a workaround is
l1, = ax2.plot(range(150),[10.]*150,color='g')
l1._transformed_path = None
l1._subslice = False
Regards,
-JJ
On Tue, Mar 8, 2011 at 6:48 AM, Hatch, Sara J (343D)
<Sar...@jp...> wrote:
> Matlplotlib folks,
>
>
>
> I copied the demo_curvelinear_grid.py example and noticed when using the
> curvelinear_test2
>
> and plotting a line that had more than 100 points that the resulting line
> doesn’t plot as expected.
>
>
>
> For example:
>
>
>
> Replacing
>
>   ax2.plot(intp(np.array([0, 30]), 50),
>
>       intp(np.array([10., 10.]), 50))
>
>
>
> with
>
>   ax2.plot(range(150),[10.]*150,color='g')
>
>   ax2.plot(range(100),[5.]*100,color='r')
>
>
>
> Shows my problem. The red line with 100 points plots just fine and as
> expected. The green line with 150 points doesn’t make any sense to me (I’ve
> attached the output plot). The line plots at the right radial value, but
> goes from 0 degrees to what looks like 14 degrees instead of 150 degrees.
>
>
>
> Is there anything in the example code or in some of the code that limits the
> number of points to 100?
>
>
>
> Thanks,
>
> Sara
>
>
>
> Software Versions:
>
> Python  : 2.6.5
>
> matplotlib.__version__ = '1.0.0'
>
>
>
> -------------------------------------------------------------------
> Sara Jean Hatch
> Inner Planet Mission Analysis Group
> Guidance, Navigation, & Control Section
> NASA - Jet Propulsion Laboratory
> 4800 Oak Grove Drive
> M/S: 301-150
> Pasadena, CA 91109
> Phone: (818) 354-8723
> -------------------------------------------------------------------
>
>
>
> ------------------------------------------------------------------------------
> What You Don't Know About Data Connectivity CAN Hurt You
> This paper provides an overview of data connectivity, details
> its effect on application quality, and explores various alternative
> solutions. http://p.sf.net/sfu/progress-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Andrea C. <and...@gm...> - 2011年03月08日 10:51:46
Goyo <goy...@gm...> writes:
>
> As Ben explained you need to draw first. So the usual path is:
> 1. Draw
> 2. Figure out the size of potentially problematic things (labels,
> titles...) and the space you need.
> 3. Adjust subplots or whatever needs adjustment to fit.
> 4. Draw again.
>
> Sort of weird but it works and I think it's widely used.
>
> Goyo
Sorry if I'm annoying, but is there any example about that?
For the text I didn't find anything using bbox_patch to compute the size
and then adapt the size of it, unless I'm blind maybe it would be nice
to add in the website for the future...
And also if I create an object of type matplotlib.Text.text how do I
actually attach it to my current figure?
Thanks,
Andrea
From: Yuri D'E. <wa...@us...> - 2011年03月08日 10:21:58
On Mon, 7 Mar 2011 13:41:49 -0600
Benjamin Root <ben...@ou...> wrote:
> > I've
> > been using matplotlib a lot the last few months and was totally
> > unaware that pyplot was "required". Good thing I read this message! :-)
I'm glad I'm not the only one :)
> > > The interface should create the figure objects, the figure objects should
> > > create the axes objects, the axes objects should create the axis objects,
> > > and so on and so forth.
I've read the revised link you posted:
https://github.com/WeatherGod/matplotlib/blob/62a02cce1ef98ff2360049ef31074bd9e82670d3/doc/faq/usage_faq.rst
I think you should definitely put the above sentence, which IMHO makes the relation of pyplot (and usage of matplotlib) astoundingly clear.
From: T J <tj...@gm...> - 2011年03月08日 09:47:01
imshow fills an entire "unit" in the grid. I'd like to overlay two
imshow's on top of each other, but in a non-destructive manner. One
way of doing this would be to modify the behavior of imshow so that it
only fills a portion of each "unit" in the grid. For example, in the
first imshow, I'd fill everything below the diagonal and in the second
imshow, I'd fill everything above the diagonal.
Would this type of modification to AxesImage be feasible? Or should I
just (manually) make a PolyCollection for each imshow? I'd still want
interpolations to work as expected, but where filling (or not) is
restricted to a region within the "unit". Generally, I think this
could be a nice addition to mpl, but if there is a more typical way of
visualizing two imshows on the same axis, I might try that instead.
thanks.
From: Yuri D'E. <wa...@us...> - 2011年03月08日 09:09:09
On Tue, 8 Mar 2011 02:35:52 +0900
Jae-Joon Lee <lee...@gm...> wrote:
> On Mon, Mar 7, 2011 at 8:22 PM, Yuri D'Elia <wa...@us...> wrote:
> > With matplotlib, I have to do the following:
> >
> > legend(bbox_to_anchor=(1, 1 + ?), loc=2)
> >
> > but how do I calculate the vertical location?
> 
> Maybe you want to try something like
> 
> leg = legend([l1], ["Test"], borderaxespad=0,
> bbox_to_anchor=(1.02, 1), loc=2)
Yes it does. By removing the padding the anchoring is now perfect.
Thanks!

Showing 18 results of 18

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





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

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

More information about our ad policies

Ad destination/click URL:

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