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


Showing 9 results of 9

From: John W. <was...@gm...> - 2007年05月12日 23:27:15
Hello,
I want to use matplotlib with Plone. I have it installed on my
machine, but not for the Plone instance of Python. What are the steps
I need to take to install it so that it is recognized by the Plone
Python instance?
Thanks!
From: George N. <gn...@go...> - 2007年05月12日 19:55:12
On 12/05/07, Jouni K. Sepp=E4nen <jk...@ik...> wrote:
> J Oishi <jo...@am...> writes:
>
> > I have an interesting problem using fonts in matplotlib on OS X 10.4.
> > When I use a font other than the Bitstream Vera provided with MPL
> > 0.90.0, I cannot create readable eps files.
>
> FWIW, I have the same problem: eps files produced on OS X are huge,
> and somehow broken. My guess is that the fonts that come with OS X
> have some advanced features, which should somehow be stripped out when
> embedding into an eps file.
Yes, this is the problem. matplotlib needs straight truetype fonts
(ttf) , not the more sophisticated opentype fonts and font suitcases
that come with macosX.
Most fonts in standard Apple places:
/Users/agn/Library/Fonts/
/Library/Fonts/
/System/Library/Fonts/
are .dfont or .otf etc... these don't work.
Except e.g. sans serif InaiMathi
 fantasy Chalkboard
which are straight .ttf, so do work.
If you have e.g. Gerben Wierda's latex installation gwtex, or probably
also the mactex distribution, this comes wilth various ttf versions of
the system fonts.
E.g I have the old gwtex based on tetex which comes with
gillsans [in light heavy etc..],hoefler ( a very nice serif
font),helveticaneue,lucidagrande,optima,verdana,didot and futura.
In my distribution these fonts are in
/usr/local/teTeX/share/texmf.gwtex/fonts/truetype/gtamacfont
if you want to use fonts like this, you either have to modify the
search path in font_manager.py to include the directories *directly*
containiong the .ttf files, or symlink the .ttf files into the
matplotlib directory holding vera.ttf etc...
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packag=
es/matplotlib/mpl-data/fonts/ttf
I believe you can make your own .ttf files from any standard Mac .otf
or .dfont using Fondu
[ http://fondu.sourceforge.net/] -- again included in Wierda's teX
installations.
HTH. George Nurser.
From: Fernando P. <fpe...@gm...> - 2007年05月12日 16:57:12
On 5/12/07, Steve Schmerler <el...@gm...> wrote:
> Fernando Perez wrote:
> >
> > Did you install pstoedit? If you do, you'll see that inkscape will
> > then be able to load .eps/.ps files in a fully editable format. I've
> > used it to fix decade-old plots for which the only thing around was
> > the eps file.
> >
>
> I tried to export an .svg from MPL (0.90.0rev3131) with
> rcParams['text.usetex']=True and got a NotImplementedError (same for the pdf backend
> with usetex, see attached log). I was wondering: Is it (technically) possible to have
> .svg export capabilities with usetex-support and if so, has there been no need for
> this feature so far (not that I need it urgently, just curious..)?
There's actually a real MPL bug in there (not just the
NotImplementedError) but I'll report it separately in a minute.
> Anyway, to work with MPL-images (.ps/.eps) in Inkscape, I installed pstoedit but
> loading these files doesn't work (seems not to recognize them as images).
> Sorry if I'm driving the Inkscape-stuff a bit OT here, but:
> What version of Inkscape & friends are you using? I'm using pstoedit 3.44, Inkscape
> 0.44.1. The Latex-formula-feature of Inkscape is also not working and the error seems
> related to pstoedit. Maybe someone had similar experiences ...
>
> Thanks for any hint!
Well, unfortunately it seems that inkscape is crashing python
itself... I made a trivial .eps in mpl with:
In [1]: plot(range(10))
Out[1]: [<matplotlib.lines.Line2D instance at 0x8f45a8c>]
In [2]: title(r'Some \LaTeX $\int_0^\infty f(\gamma) d\gamma = 1$')
Out[2]: <matplotlib.text.Text instance at 0x8f4590c>
In [3]: savefig('foo.eps')
and when I tried to load it into inkscape, I got this very nasty traceback:
*** glibc detected *** /usr/bin/python: free(): invalid pointer: 0x4081e4e0 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0x400ee7cd]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0x400f1e30]
/usr/lib/skencil/Sketch/../Lib/streamfilter.so[0x404e7ce5]
/usr/lib/skencil/Sketch/../Lib/streamfilter.so[0x404e7cd2]
/usr/bin/python[0x8110e6a]
/usr/bin/python(PyEval_EvalCodeEx+0x313)[0x80c9903]
etc.
At this point, this is really becoming OT for the mpl list, so I'll
stop. But if anyone has the time, it might be worth sending this
example to the inkscape list so they work on it and hopefully fix it.
Cheers,
f
From: <jk...@ik...> - 2007年05月12日 16:22:08
Jochen Küpper <jo...@fh...> writes:
>> for the PostScript backend using (I think) dvips with psfrag, and
>> neither of these is easily generalizable to work with svg or pdf.
>
> What's the problem of using dvi2pdf, dvipdfm, dvipdfmx, or soemthing
> like that for PDF?
> Looks quite similar to the dvips route for Postscript to me?
The dvips route is not so simple. First matplotlib creates the
PostScript file with all text strings replaced by tags, and this is
fed to LaTeX using \includegraphics. The psfrag package replaces the
tags with LaTeX constructs, and then the dvi file is converted using
dvips into the final postscript file. There is no equivalent to psfrag
that works with pdf (at least none that I know of).
Probably you could create a pdf file without any texts and input that
in your LaTeX file, and then -- with sufficient LaTeX-fu -- render the
text strings at the correct positions, and run the LaTeX file through
pdflatex, because pdftex includes a pdf parser so that you can do
\includegraphics{foo.pdf}. So in that sense it may be generalizable,
but it won't be a direct port of the ps backend.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: <jo...@fh...> - 2007年05月12日 15:58:47
Attachments: PGP.sig
On 12.05.2007, at 16:37, Jouni K. Sepp=E4nen wrote:
> for the PostScript backend using (I think) dvips with psfrag, and =20
> neither of these is easily generalizable to work with svg or pdf.
What's the problem of using dvi2pdf, dvipdfm, dvipdfmx, or soemthing =20
like that for PDF?
Looks quite similar to the dvips route for Postscript to me?
Greetings,
Jochen
--=20
Einigkeit und Recht und Freiheit http://www.Jochen-=20
Kuepper.de
 Libert=E9, =C9galit=E9, Fraternit=E9 GnuPG key: =
CC1B0B4D
 Sex, drugs and rock-n-roll
From: <jk...@ik...> - 2007年05月12日 15:30:06
J Oishi <jo...@am...> writes:
> I have an interesting problem using fonts in matplotlib on OS X 10.4. 
> When I use a font other than the Bitstream Vera provided with MPL 
> 0.90.0, I cannot create readable eps files.
FWIW, I have the same problem: eps files produced on OS X are huge,
and somehow broken. My guess is that the fonts that come with OS X
have some advanced features, which should somehow be stripped out when
embedding into an eps file.
Perhaps one way to address the problem would be to use fonttools1 to
read the font file, prune the resulting data structure to include just
the characters needed, and again use fonttools to output the structure
into the eps file.
1 http://sourceforge.net/projects/fonttools/
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: <jk...@ik...> - 2007年05月12日 14:38:04
Steve Schmerler <el...@gm...> writes:
> I was wondering: Is it (technically) possible to have .svg export
> capabilities with usetex-support and if so, has there been no need
> for this feature so far
The usetex feature is implemented for the Agg backend (i.e., png
output) using dvipng, and for the PostScript backend using (I think)
dvips with psfrag, and neither of these is easily generalizable to
work with svg or pdf. However, some time ago I committed the
beginnings of a dvi parser and a little support code in the pdf
backend, enough to get a small demo almost working:
http://article.gmane.org/gmane.comp.python.matplotlib.devel/2687
I have no idea how difficult it would be to get this working in the
svg backend, but in the pdf backend the biggest hurdle is probably in
generalizing the current font support so that the TeX fonts can be
embedded.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Steve S. <el...@gm...> - 2007年05月12日 13:52:37
Attachments: error.log
Fernando Perez wrote:
> 
> Did you install pstoedit? If you do, you'll see that inkscape will
> then be able to load .eps/.ps files in a fully editable format. I've
> used it to fix decade-old plots for which the only thing around was
> the eps file.
> 
I tried to export an .svg from MPL (0.90.0rev3131) with
rcParams['text.usetex']=True and got a NotImplementedError (same for the pdf backend
with usetex, see attached log). I was wondering: Is it (technically) possible to have
.svg export capabilities with usetex-support and if so, has there been no need for
this feature so far (not that I need it urgently, just curious..)?
Anyway, to work with MPL-images (.ps/.eps) in Inkscape, I installed pstoedit but
loading these files doesn't work (seems not to recognize them as images).
Sorry if I'm driving the Inkscape-stuff a bit OT here, but:
What version of Inkscape & friends are you using? I'm using pstoedit 3.44, Inkscape
0.44.1. The Latex-formula-feature of Inkscape is also not working and the error seems
related to pstoedit. Maybe someone had similar experiences ...
Thanks for any hint!
-- 
cheers,
steve
I love deadlines. I like the whooshing sound they make as they fly by. -- Douglas Adams
From: J O. <jo...@am...> - 2007年05月12日 10:35:04
Hi,
I have an interesting problem using fonts in matplotlib on OS X 10.4. 
When I use a font other than the Bitstream Vera provided with MPL 
0.90.0, I cannot create readable eps files. More specifically, if I 
use a font from the OS X system choices, MPL happily creates an eps 
file, but it causes errors in preview, imagemagick, and ps2pdf. This 
occurs if I use either the PS or the TkAgg backend to create the eps 
file:
[joishi@ebisu test]$ ps2pdf test.eps
Error: /invalidfont in -dict-
Operand stack:
 Futura-Medium --dict:11/14(L)-- Font Futura-Medium --dict: 
11/14(L)-- Futura-Medium
Execution stack:
 %interp_exit .runexec2 --nostringval-- --nostringval-- -- 
nostringval-- 2 %stopped_push --nostringval-- -- 
nostringval-- --nostringval-- false 1 %stopped_push 1 3 
%oparray_pop 1 3 %oparray_pop --nostringval-- 1 3 % 
oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- -- 
nostringval-- --nostringval-- 2 %stopped_push -- 
nostringval-- 2 4 %oparray_pop 3 4 %oparray_pop -- 
nostringval-- --nostringval-- --nostringval-- 7 5 % 
oparray_pop --nostringval-- 7 5 %oparray_pop
Dictionary stack:
 --dict:1120/1686(ro)(G)-- --dict:0/20(G)-- --dict:75/200 
(L)-- --dict:6/7(L)-- --dict:17/17(ro)(G)--
Current allocation mode is local
Last OS error: 2
Current file position is 618791
AFPL Ghostscript 8.51: Unrecoverable error, exit code 1
However, if the output is NOT eps, I can create and view pdf, png, 
and TkAgg plots with whatever font I choose. A code sample that 
produces the above error on eps output is below.
I hope someone might be able to shed some light on my problem. I have 
not been able to test the eps file on another platform; the bug may 
well rest on OS X outside of MPL. Unfortunately, I need eps files for 
a journal, and I would like to use a font other than Vera.
thanks,
jeff oishi
#!/usr/bin/env python
from matplotlib import rcParams
import pylab as P
import numpy as N
#this makes no difference
#rcParams['backend'] = 'PS'
rcParams['backend'] = 'TkAgg'
# this fails
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = 'Futura'
# this succeeds
#rcParams['font.family'] = 'serif'
#rcParams['font.serif'] = 'Bitstream Vera Serif'
if __name__ == "__main__":
 x = N.linspace(0,2*N.pi,1000)
 y = N.sin(x)
 P.plot(x,y)
 P.xlabel('test')
 P.ylabel('another test')
 P.savefig('test.eps')

Showing 9 results of 9

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