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






Showing results of 120

1 2 3 .. 5 > >> (Page 1 of 5)
From: John H. <jdh...@ac...> - 2004年10月29日 18:03:47
>>>>> "Carl" == Carl Dr Kleffner <cmk...@gm...> writes:
 >> 
 Carl> I will take that script (and use the output of the ttx
 Carl> fonttool as well) to estimate the glyph ids for each latex
 Carl> symbol. This will take a week or so. If it is not possible
 Carl> to reach the charmap values by get_charmap for the belleek
 Carl> fonts one could use an additional dict with the charmaps
 Carl> values.
I believe I have fixed the problem with the bl*.ttf fonts. I exposed
FT_Set_Charmap via font.set_charmap in ft2font and calling
font.set_charmap(0) seems to cure the problem with the bl* fonts.
Apparently, there isn't a default charmap set for those fonts - no
exactly sure.
In any case, I updated CVS -- make sure you have at least revision
1.10 of ft2font.cpp and the updated script at
http://matplotlib.sf.net/share/font_table.py
Have fun :-) Perhaps we should move further discussion on this issue
over to the matplotlib-devel list.
JDH
From: Carl D. K. <cmk...@gm...> - 2004年10月29日 14:59:37
Dear John
> ...
> Perhaps others can give input here about what would be the best way to
> proceed. My inclination is to use the TeX names like \"a where
> possible, but by all means add them if you have them - getting the
> codes is the relatively tedious part, providing the proper interface
> to them can be worked out later. It may require some changes to the
> parser to support \"a and friends, but this is no problem.
> 
I will take that script (and use the output of the ttx fonttool as well)
to estimate the glyph ids for each latex symbol. This will take
a week or so. If it is not possible to reach the charmap values
by get_charmap for the belleek fonts one could use an additional
dict with the charmaps values.
> Now, on to the "mostly working" part of the font_table script, which
> is why I CCd Paul on this email. The font_table script is working on
> the um*.ttf fonts but failing on the bl*.ttf fonts. The reason it is
> failing is that FT2Font::get_charmap is returning an empty dict.
> These fonts are not empty, eg ft2font reports 1 face, 2 charmaps, and
> 124 glyphs for blsy.ttf, but get_charmap is returning empty, because
> the call to
> 
> FT_ULong code = FT_Get_First_Char(face, &index);
> 
> is returning 0 for code and index.
> 
> Any ideas? 
> 
> JDH
> 
Maybe because this fonts use charmaps values beyond 0x20:
 <cmap_format_4 platformID="3" platEncID="0" version="0">
 <map code="0x1" name="Delta"/><!-- &lt;control> -->
 <map code="0x2" name="Theta"/><!-- &lt;control> -->
 <map code="0x3" name="Lambda"/><!-- &lt;control> -->
A cmap value for 0x0 is missing:
 <map code="0x0" name=".null"/> (um fonts)
But this is just a wild guess.
Regards 
Carl
-- 
Geschenkt: 3 Monate GMX ProMail + 3 Top-Spielfilme auf DVD
++ Jetzt kostenlos testen http://www.gmx.net/de/go/mail ++
From: John H. <jdh...@ac...> - 2004年10月29日 14:21:14
>>>>> "Carl" =3D=3D Carl Dr Kleffner <cmk...@gm...> writes:
 Carl> I would like to try this. Due to time constraints, it may
 Carl> take some time. As far as I understand I have to use the
 Carl> GlyphIDs as well as the map code from cmap_format_4 to
 Carl> create a latex_to_umbelleek dictionary. Any hints from font
 Carl> experts are appreciated.
The minimum you need to do is provide a dictionary that maps TeX
symbol name to the fontname/glyphindex for that symbol. Eg for \pm in
bakoma, the font name is cmsy10.ttf, the glyph index is 8 , the
character code is 167 (hex is 0xa7) and the glyph name is plusminus.
The entry in the latex_to_bakoma dict is
 r'\pm' : ('cmsy10', 8),
From the fontname and glyph index, we can get the character code and
glyphname from the ttf file. I have written a little helper script
for you. It's brute force and ain't terribly pretty, but it (mostly,
see below) works.
 http://matplotlib.sf.net/share/font_table.py
This creates a font grid table png using the agg backend and
matplotlib's ft2font module - you'll probably want to get the latest
CVS matplotlib for this to work properly - I'm not 100% sure this is
required but it is at least strongly recommended.
It will produce font grid images for the font specified on the command
like, like the following for umr10.ttf
 http://matplotlib.sf.net/share/umr10.ttf.png
You can use these grid tables to get the hex charcode code of the
symbol you want, and the output of the script lists the glyphind,
ccode, hex(ccode), and name, sorted by charcode, so you can look up
the glyphind form the hex code. Ie
 1) Pick a new tex symbol.
 2) Find the corresponding character in one of the umbellek font
 table pngs, or by using the glyph names listed when you run the
 font_table script.
 3) Use the font_table output to get the glyphind corresponding to
 the symbol/name of interest.
 4) GOTO 1
There is probably a better way, but with a combination of glyphnames
and grid tables you can knock this out in several hours of tedious
work. Any other information you want to attach while you are in the
thick of it (mathml names, unicode chars) would be a great, but is not
necessary.
 Carl> I would like to add codes for accented chars: r'=E4':
 Carl> ('umr10', <code>) Should _mathtext_data.py contain a
 Carl> encoding line, i.e. # -*- coding: latin1 -*- to allow
 Carl> non-Ascii chars?
Perhaps others can give input here about what would be the best way to
proceed. My inclination is to use the TeX names like \"a where
possible, but by all means add them if you have them - getting the
codes is the relatively tedious part, providing the proper interface
to them can be worked out later. It may require some changes to the
parser to support \"a and friends, but this is no problem.
Now, on to the "mostly working" part of the font_table script, which
is why I CCd Paul on this email. The font_table script is working on
the um*.ttf fonts but failing on the bl*.ttf fonts. The reason it is
failing is that FT2Font::get_charmap is returning an empty dict.
These fonts are not empty, eg ft2font reports 1 face, 2 charmaps, and
124 glyphs for blsy.ttf, but get_charmap is returning empty, because
the call to
 FT_ULong code =3D FT_Get_First_Char(face, &index);
is returning 0 for code and index.
Any ideas? =20
JDH
From: Carl D. K. <cmk...@gm...> - 2004年10月29日 06:47:23
> >>>>> "Carl" == Carl Dr Kleffner <cmk...@gm...> writes:
> 
> Carl> Any thoughts to use Richard Kinchs Universal Modern fonts as
> Carl> well as the bellek fonts on his site (www.truetex.com)
> Carl> instead of the bakoma fonts? It seems that um and bellek are
> Carl> free to use and redistributable. This is not the case for
> Carl> bakoma in commercial use. The quality of the fonts are
> Carl> excellent. Umlauts and more special signs are included
> Carl> compared to bakoma. The charnums are different however and
> Carl> not included on mozillas encoding page.
> 
> I would be very happy to support these fonts, especially if someone
> (you, perhaps) provided the dictionary mapping tex symbol names to
> name/charnum, as in the latex_to_bakoma dictionary in
> matplotlib._mathtext_data. The rest is easy, and I could provide an
> rc param allowing you to select which fonts to include. 
> 
> ...
> 
> JDH
> 
I would like to try this. Due to time constraints, it may take some
time. As far as I understand I have to use the GlyphIDs as well as
the map code from cmap_format_4 to create a latex_to_umbelleek 
dictionary. Any hints from font experts are appreciated.
I would like to add codes for accented chars: r'ä': ('umr10', <code>)
Should _mathtext_data.py contain a encoding line, i.e.
# -*- coding: latin1 -*-
to allow non-Ascii chars?
Regards
Carl
-- 
NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl
GMX DSL-Netzanschluss + Tarif zum supergünstigen Komplett-Preis!
From: Robert K. <rk...@uc...> - 2004年10月29日 02:15:01
John Hunter wrote:
>>>>>>"Robert" == Robert Kern <rk...@uc...> writes:
> 
> 
> Robert> [Sorry for the self-reply]
> 
> Happens to the best of us :-)
> 
> >> Does
> >> http://www.dessci.com/fr/support/tech/encodings/font_enc.stm
> >> help?
> 
> Robert> No, it in fact does not.
> 
> Well it may actually, since these pages provide the unicode indices
> for some of the cm fonts. We already have tex symbol -> char code for
> the bakoma fonts in _mathtext_data, and they have the char code ->
> unicode mappings in their "Character List", so it should be trivial to
> build all the forward and backwards dicts we need. Although I didn't
> see any explicit reference to bakoma, they appear to be using them;
> eg, compare the encodings at
> 
> http://www.dessci.com/en/support/tech/encodings/texcmrom.htm
> 
> and 
> 
> http://www.mozilla.org/projects/mathml/fonts/encoding/cmr-ttf-encoding.html
> 
> Or is it just late and I've gone soft in the head?
Okay, it does help for mapping the encoding used in the CM TrueType font 
to Unicode. This is not the same encoding used in the TFM files which is 
what I was thinking of.
-- 
Robert Kern
rk...@uc...
"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
 -- Richard Harter
From: John H. <jdh...@ac...> - 2004年10月29日 02:04:42
>>>>> "Robert" == Robert Kern <rk...@uc...> writes:
 Robert> [Sorry for the self-reply]
Happens to the best of us :-)
 >> Does
 >> http://www.dessci.com/fr/support/tech/encodings/font_enc.stm
 >> help?
 Robert> No, it in fact does not.
Well it may actually, since these pages provide the unicode indices
for some of the cm fonts. We already have tex symbol -> char code for
the bakoma fonts in _mathtext_data, and they have the char code ->
unicode mappings in their "Character List", so it should be trivial to
build all the forward and backwards dicts we need. Although I didn't
see any explicit reference to bakoma, they appear to be using them;
eg, compare the encodings at
 http://www.dessci.com/en/support/tech/encodings/texcmrom.htm
and 
 http://www.mozilla.org/projects/mathml/fonts/encoding/cmr-ttf-encoding.html
Or is it just late and I've gone soft in the head?
JDH
From: John H. <jdh...@ac...> - 2004年10月28日 22:07:30
>>>>> "Dan" == Dan <da...@ya...> writes:
 Dan> I compiled matplotlib fine. But when importing it, I got this
 Dan> message:
..snip..
 Dan> import matplotlib
 >>>> matplotlib.use('Agg') import matplotlib.matlab as Mat
 Dan> LazyValue::init_type Value::init_type BinOp::init_type
 Dan> Point::init_type Interval::init_type Bbox::init_type
You have compiled matplotlib with VERBOSE set to True in setup.py.
Set VERBOSE=False and
> rm -rf build
and recompile. Should work...
JDH
From: Dan <da...@ya...> - 2004年10月28日 21:55:02
I compiled matplotlib fine. But when importing it, I
got this message:
Python 2.3.4 (#1, Oct 25 2004, 20:36:25) 
[GCC 3.3.1 (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import os,sys,time, string
import Numeric as N
import matplotlib 
>>> matplotlib.use('Agg') 
>>> import matplotlib.matlab as Mat
LazyValue::init_type
Value::init_type
BinOp::init_type
Point::init_type
Interval::init_type
Bbox::init_type
Func::init_type
FuncXY::init_type
Transformation::init_type
SeparableTransformation::init_type
NonseparableTransformation::init_type
Affine::init_type
init_nc_transforms
_transforms_module::new_value 
_transforms_module::new_value 
_transforms_module::new_point 
Point::Point
_transforms_module::new_value 
_transforms_module::new_value 
_transforms_module::new_point 
Point::Point
_transforms_module::new_bbox 
Bbox::Bbox
_transforms_module::new_value 
_transforms_module::new_value 
_transforms_module::new_point 
Point::Point
_transforms_module::new_value 
_transforms_module::new_value 
_transforms_module::new_point 
Point::Point
_transforms_module::new_bbox 
Bbox::Bbox
_transforms_module::new_value 
_transforms_module::new_value 
_transforms_module::new_point 
Point::Point
_transforms_module::new_value 
_transforms_module::new_value 
_transforms_module::new_point 
Point::Point
_transforms_module::new_bbox 
Bbox::Bbox
_transforms_module::new_func 
_transforms_module::new_func 
_transforms_module::new_separable_transformation 
BBoxTransformation::BBoxTransformation
SeparableTransformation::SeparableTransformation
Glyph::init_type
FT2Font::init_type
init_nc_image
Image::init_type
		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 
From: Robert K. <rk...@uc...> - 2004年10月28日 03:35:02
[Sorry for the self-reply]
Robert Kern wrote:
> Does http://www.dessci.com/fr/support/tech/encodings/font_enc.stm help?
No, it in fact does not.
-- 
Robert Kern
rk...@uc...
"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
 -- Richard Harter
From: Robert K. <rk...@uc...> - 2004年10月27日 23:51:00
John Hunter wrote:
> Awesome - impressive work for an afternoon. Thanks for pointing me to
> that dvi specification reference. I was trying to discern the format
> from TeX: The Program, which despite its literate style, was less
> accessible than the reference you pointed to. It is painful, though,
> as you say, no matter how you slice it.
> 
> Funny that I missed tftopl in my hunt for a parser, which was sitting
> right on my system the whole time.
I know how you feel. *Believe* me. In any case, please use tftopl. I'm 
pretty sure there's a bug in how tfm.py reads the fixed-point values, 
but I'm giving up in favor of tftopl.
> In order to use this information in mathtext, we have reconstruct the
> mapping from TeX symbol name to font and character number for each of
> the tex symbols we use (cmr10, cmi10, cmex10 and cmsy10) . Currently
> mathtext hardcodes the mapping from tex name to bakoma
> fontname/number.
> 
> A better approach would be to use either the mathml or unicode number
> as the internal code for each symbol, and then provide mappings from
> these to the tfm fontname/charnum and to the corresponding tex symbol
> names - my guess is that this has already been done and we just have
> to dig it up.
Does http://www.dessci.com/fr/support/tech/encodings/font_enc.stm help?
> Then we could use any of the fonts (Wolfram, Design Science, Symbol,
> AMS, Bakoma) at http://www.mozilla.org/projects/mathml/fonts/encoding
> for matplotlib mathtext, since the mapping from mathml/unicode to
> fontname/charnum already exists on pages like
> http://www.mozilla.org/projects/mathml/fonts/encoding/cmr.html, and is
> easily parsed (I already did this when I was working on PS mathtext
> with type1 fonts before Paul had the bright idea of just embedding the
> truetype fonts in the ps document and reusing what we already had.
> 
> In summary, it would be nice to be able to readily go from tex name
> <-> mathml/unicode name <-> fontname/charnum in a variety of files,
> including at a minimum the bakoma ttf and the corresponding tfm files.
> Got some images to process today <wink>
> 
> Does this sound like the right approach to you?
More or less. Converting from TeX encodings (which are arcane) to modern 
standards as soon as possible is almost certainly the best approach.
-- 
Robert Kern
rk...@uc...
"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
 -- Richard Harter
From: John H. <jdh...@ac...> - 2004年10月27日 21:35:50
>>>>> "Carl" == Carl Dr Kleffner <cmk...@gm...> writes:
 Carl> Any thoughts to use Richard Kinchs Universal Modern fonts as
 Carl> well as the bellek fonts on his site (www.truetex.com)
 Carl> instead of the bakoma fonts? It seems that um and bellek are
 Carl> free to use and redistributable. This is not the case for
 Carl> bakoma in commercial use. The quality of the fonts are
 Carl> excellent. Umlauts and more special signs are included
 Carl> compared to bakoma. The charnums are different however and
 Carl> not included on mozillas encoding page.
I would be very happy to support these fonts, especially if someone
(you, perhaps) provided the dictionary mapping tex symbol names to
name/charnum, as in the latex_to_bakoma dictionary in
matplotlib._mathtext_data. The rest is easy, and I could provide an
rc param allowing you to select which fonts to include. 
We ought to expose the glyph names through FT_Get_Glyph_Name in the
ft2font module to facilitate this kind of thing.... I notice that,
for example, blex.ttf uses names like
 ceilingleftbigg ceilingrightbigg braceleftbigg bracerightbigg
 angbracketleftbigg angbracketrightbigg slashbigg backslashbigg
 parenleftBigg
which would make it fairly easy to do the mapping.
Since the bakoma fonts are the only things in the matplotlib distro
restricted for free, noncommercial use, this would be a nice addition.
If we later decide to go with a mathml/unicode representation
internally, it would be trivial to automatically convert the existing
dictionaries in _mathtext_data.
JDH
From: Carl D. K. <cmk...@gm...> - 2004年10月27日 16:40:40
> Then we could use any of the fonts (Wolfram, Design Science, Symbol,
> AMS, Bakoma) at http://www.mozilla.org/projects/mathml/fonts/encoding
> for matplotlib mathtext, since the mapping from mathml/unicode to
> fontname/charnum already exists on pages like
> http://www.mozilla.org/projects/mathml/fonts/encoding/cmr.html, and is
> easily parsed (I already did this when I was working on PS mathtext
> with type1 fonts before Paul had the bright idea of just embedding the
> truetype fonts in the ps document and reusing what we already had.
> 
Any thoughts to use Richard Kinchs Universal Modern fonts as well
as the bellek fonts on his site (www.truetex.com) instead of 
the bakoma fonts? It seems that um and bellek are free to use and 
redistributable. This is not the case for bakoma in commercial use.
The quality of the fonts are excellent. Umlauts and more special 
signs are included compared to bakoma. The charnums are different 
however and not included on mozillas encoding page.
Regards
Carl-M Kleffner
> In summary, it would be nice to be able to readily go from tex name
> <-> mathml/unicode name <-> fontname/charnum in a variety of files,
> including at a minimum the bakoma ttf and the corresponding tfm files.
> Got some images to process today <wink>
> 
> Does this sound like the right approach to you?
> 
> JDH
> 
>
-- 
NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl
GMX DSL-Netzanschluss + Tarif zum supergünstigen Komplett-Preis!
From: John H. <jdh...@ac...> - 2004年10月27日 14:44:16
>>>>> "Robert" == Robert Kern <rk...@uc...> writes:
 John> Another idea I had while reading Knuth's "TeX: The Program"
 John> is to use the layout information in the TFM font metric
 John> files. Apparently math fonts have additional layout
 John> information in them, like where to place superscripts. I've
 John> looked at several tfm parsing implementations, and
 Robert> I wish you luck!
Who needs luck when we've got people like you around! :-)
 Robert> Taking this as a challenge (and having little to do while
 Robert> waiting for images to process), I wrote a TFM parser that
 Robert> handles the extra parameters for math symbols. This
 Robert> format[1] is excruciatingly painful.
 Robert> http://starship.python.net/crew/kernr/tfm.py
 Robert> And then I realized that the output of tftopl(1) is
 Robert> incredibly easy to parse and contains the same
 Robert> information. <sigh>
 Robert> Either way, you now have the information you need for some
 Robert> fonts, at least.
Awesome - impressive work for an afternoon. Thanks for pointing me to
that dvi specification reference. I was trying to discern the format
from TeX: The Program, which despite its literate style, was less
accessible than the reference you pointed to. It is painful, though,
as you say, no matter how you slice it.
Funny that I missed tftopl in my hunt for a parser, which was sitting
right on my system the whole time.
In order to use this information in mathtext, we have reconstruct the
mapping from TeX symbol name to font and character number for each of
the tex symbols we use (cmr10, cmi10, cmex10 and cmsy10) . Currently
mathtext hardcodes the mapping from tex name to bakoma
fontname/number.
A better approach would be to use either the mathml or unicode number
as the internal code for each symbol, and then provide mappings from
these to the tfm fontname/charnum and to the corresponding tex symbol
names - my guess is that this has already been done and we just have
to dig it up.
Then we could use any of the fonts (Wolfram, Design Science, Symbol,
AMS, Bakoma) at http://www.mozilla.org/projects/mathml/fonts/encoding
for matplotlib mathtext, since the mapping from mathml/unicode to
fontname/charnum already exists on pages like
http://www.mozilla.org/projects/mathml/fonts/encoding/cmr.html, and is
easily parsed (I already did this when I was working on PS mathtext
with type1 fonts before Paul had the bright idea of just embedding the
truetype fonts in the ps document and reusing what we already had.
In summary, it would be nice to be able to readily go from tex name
<-> mathml/unicode name <-> fontname/charnum in a variety of files,
including at a minimum the bakoma ttf and the corresponding tfm files.
Got some images to process today <wink>
Does this sound like the right approach to you?
JDH
From: Robert K. <rk...@uc...> - 2004年10月27日 03:57:51
John Hunter wrote:
> Another idea I had while reading Knuth's "TeX: The Program" is to use
> the layout information in the TFM font metric files. Apparently math
> fonts have additional layout information in them, like where to place
> superscripts. I've looked at several tfm parsing implementations, and
> haven't found one yet that actually extracts this information; most
> extract the standard font information but not the special math
> information. But if we could access this info, we could include the
> tfm files for common raster sizes and use the layout info crafted by
> the master himself.
Taking this as a challenge (and having little to do while waiting for 
images to process), I wrote a TFM parser that handles the extra 
parameters for math symbols. This format[1] is excruciatingly painful.
http://starship.python.net/crew/kernr/tfm.py
And then I realized that the output of tftopl(1) is incredibly easy to 
parse and contains the same information. <sigh>
Either way, you now have the information you need for some fonts, at least.
[1] 
http://www.ctan.org/tex-archive/dviware/driv-standard/level-0/dvistd0.pdf
-- 
Robert Kern
rk...@uc...
"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
 -- Richard Harter
From: Samir P. <mep...@ya...> - 2004年10月27日 03:10:07
After this fix to pycxx, I was able to create
matplotlib fine (with pygtk 2.4 patch). Thanks for a
quick response.
--- John Hunter <jdh...@ac...> wrote:
> >>>>> "Samir" == Samir Patel <mep...@ya...>
> writes:
> 
> Samir> I am getting following error while
> compiling later version
> Samir> of matplotlib with gcc 3.4.2: Any clue?
> 
> This is a pycxx bug that is fixed in pycxx and
> matplotlib cvs. See
>
http://sourceforge.net/mailarchive/message.php?msg_id=9683332
> for the
> solution -- replace map(s) with map(m) on the
> offending line 2271 in
> CXX/Objects.hxx.
> 
> Hope this helps,
> JDH
> 
		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 
From: John H. <jdh...@ac...> - 2004年10月27日 01:59:29
>>>>> "Samir" == Samir Patel <mep...@ya...> writes:
 Samir> I am getting following error while compiling later version
 Samir> of matplotlib with gcc 3.4.2: Any clue?
This is a pycxx bug that is fixed in pycxx and matplotlib cvs. See
http://sourceforge.net/mailarchive/message.php?msg_id=9683332 for the
solution -- replace map(s) with map(m) on the offending line 2271 in
CXX/Objects.hxx.
Hope this helps,
JDH
From: Dominique O. <dom...@po...> - 2004年10月27日 00:49:32
> Date: 2004年10月25日 20:40:02 -0400
> From: Gary <pa...@in...>
> To: Chris Barker <Chr...@no...>
> CC: mat...@li...
> Subject: Re: [Matplotlib-users] TeX in xlabel ?
>
> Chris Barker wrote:
>
> > Gary wrote:
> >
> >> AFAICT, It is not possible to mix text and TeX symbols in a string
> >> and have it come out right. For example, in
> >>
> >> xlabel(r'$\rm{Normalized Temperature} (kT/\epsilon)$'
> >> The text comes out in TeX math mode ... not so pretty. Please tell
> >> me what I've overlooked.
> >
> >
> > well, I'm not sure how this is supported in matplotlib, but in
> > LaTex,you would do:
> >
> > Normalized Temperature $(kT/\epsilon)$
> >
> > or:
> >
> > $\text{Normalized Temperature} (kT/\epsilon)$
> >
> > the "$" means put it in math mode, if you don't want "Normalized
> > Temperature" in math mode, don't put it inside the $$. The second puts
> > it all in math mode, but the text{} means set this in text mode.
> >
> > -Chris
> >
> Matplotlib doesn't support \text, and it requires that the first and
> last characters of a TeX string be $. I guess it only processes
> mathmode. Well, it can't do *everything*. It would be nice to figure
> out a workaround...
Gary's example
 xlabel(r'$\rm{Normalized Temperature} (kT/\epsilon)$'
USED to work, in earlier versions of Matplotlib. It no longer does. I have
posted a similar issue a little while ago:
 http://sourceforge.net/mailarchive/message.php?msg_id=9681306
Unfortunately, I haven't really had the time to dig into the code to see what
has changed, but when I do, I'll let you know what I find. The solution
 xlabel(r'$\rm{Normalized \ Temperature} (kT/\epsilon)$'
somehow isn't entirely satisfactory.
As far as I can see, \rm{} in Matplotlib should act just the way \mbox{} does in
LaTeX, when you are already in math mode. And certainly, in LaTeX,
$$
xy = 0 \mbox{ but however } x \neq y
$$
produces the expected output in the expected fonts and with the expected
spacing.
Dominique
From: Samir P. <mep...@ya...> - 2004年10月26日 23:59:17
I am getting following error while compiling later
version of matplotlib with gcc 3.4.2: Any clue?
**********************************************
running build_ext
building 'matplotlib._nc_transforms' extension
creating build/temp.linux-i686-2.3
creating build/temp.linux-i686-2.3/src
creating build/temp.linux-i686-2.3/CXX
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3
-Wall -Wstrict-prototypes -fPIC -Isrc -I.
-I/usr/include/python2.3 -c
CXX/IndirectPythonInterface.cxx -o
build/temp.linux-i686-2.3/CXX/IndirectPythonInterface.o
-DNUMERIC=1
cc1plus: warning: command line option
"-Wstrict-prototypes" is valid for C/ObjC but not for
C++
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3
-Wall -Wstrict-prototypes -fPIC -Isrc -I.
-I/usr/include/python2.3 -c CXX/cxxsupport.cxx -o
build/temp.linux-i686-2.3/CXX/cxxsupport.o -DNUMERIC=1
cc1plus: warning: command line option
"-Wstrict-prototypes" is valid for C/ObjC but not for
C++
In file included from CXX/cxxsupport.cxx:6:
./CXX/Objects.hxx: In constructor
`Py::MapBase<T>::const_iterator::const_iterator(const
Py::MapBase<T>*, Py::List,
Py::SeqBase<Py::Object>::iterator)':
./CXX/Objects.hxx:2271: error: `s' undeclared (first
use this function)
./CXX/Objects.hxx:2271: error: (Each undeclared
identifier is reported only once for each function it
appears in.)
error: command 'gcc' failed with exit status 1
[spatel@taamportable matplotlib-0.63.4]$ gcc --version
gcc (GCC) 3.4.2
		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 
From: Robert K. <rk...@uc...> - 2004年10月26日 20:58:32
John Hunter wrote:
[snip]
> One is to fall back on tex where available as a command line tool (as
> pyx does, I believe), and use other command line tools to convert the
> dvi to png or some other raster format and then embed it. This would
> require a few external libs and utilities, but it's certainly doable.
+1 for (relatively) low-hanging fruit.
> Another idea I had while reading Knuth's "TeX: The Program" is to use
> the layout information in the TFM font metric files. Apparently math
> fonts have additional layout information in them, like where to place
> superscripts. I've looked at several tfm parsing implementations, and
> haven't found one yet that actually extracts this information; most
> extract the standard font information but not the special math
> information. But if we could access this info, we could include the
> tfm files for common raster sizes and use the layout info crafted by
> the master himself.
I wish you luck!
> A third possibility would be to support mathml, using some good mathml
> renderer. Is there a good, free mathml rendering library - what does
> mozilla use for this?
Mozilla's MathML is inextricably linked into Gecko[1] and cannot be torn 
out of it.
I've seen some programs out there that render MathML to either rasters 
or SVG, but they are either commercial or (L)GPL. They are also usually 
written in Java or C#.
Some possibilities gleaned from 
http://www.w3.org/Math/implementations.html :
* GtkMathView: C++, GPL, already has Perl and PHP bindings
 http://helm.cs.unibo.it/mml-widget/
Okay, that was the only one I found.
In any case, I would not want to be directly writing MathML; it is not 
intended to be human-writable. There are, however, programs that will 
convert a restricted mathematical subset of LaTeX to MathML[2]. There 
are also a few non-TeX syntaxes drifting around with converters to MathML.
[1] http://www.mozilla.org/projects/mathml/enable.html
[2] http://pear.math.pitt.edu/mathzilla/
-- 
Robert Kern
rk...@uc...
"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
 -- Richard Harter
From: Chris B. <Chr...@no...> - 2004年10月26日 19:45:01
John Hunter wrote:
>>>>>>"Chris" == Chris Barker <Chr...@no...> writes:
> 
> 
> Chris> Gary wrote:
> >> Matplotlib doesn't support \text, and it requires that the
> >> first and last characters of a TeX string be $. I guess it
> >> only processes mathmode. Well, it can't do *everything*.
> 
> It is on the goals page (http://matplotlib.sourceforge.net/goals.html)
> to support embedded math strings like
> 
> s = r'Mean ($\mu=5) and standard deviation ($\sigma=1$)'
did you mean:
s = r'Mean ($\mu=5$) and standard deviation ($\sigma=1$)'
I think there was a missing "$".
That would be nice.
> It would be nice to be able to choose one or the other --
that would be nice.
> It would be a monster job. There is basically no way to factor tex
> into components -- it's a monolithic system, in part because of the
> heavy use of web macros.
Ah. too bad. It's nice to know you've looked into this some.
 > And web2c, the conversion of web/pascal to
> c, is GPLd and less permissive than the matplotlib license. So
> embedding tex is a no-go, aside from size considerations.
web2c is essentially a compiler of sorts, isn't it? So there wouldn't be 
 any problem with distributing C code created by it would there? In any 
case, there are LOTS of commercial TeX distributions out there, so there 
must be a way. This doesn't address the other big issues, however.
AmiPro, the word processor bought by Lotus, then later turned into 
WordPro, used TeX to format math. I used it for years before I 
discovered LaTeX because it had such nice math rendering (MS Word's 
still sucks!). They somehow managed to embed it, so I suppose it can be 
done! That doesn't mean it's the least bit easy, however.
> But there
> are some possibilities for improving what matplotlib already offers.
good news, of course.
> One is to fall back on tex where available as a command line tool (as
> pyx does, I believe), and use other command line tools to convert the
> dvi to png or some other raster format and then embed it. This would
> require a few external libs and utilities, but it's certainly doable.
That would be a nice option, but I'd rather see a DVI driver built in to 
Matplotlib, than a raster format. That's how PyX does it. I guess that 
would require matplotlib to have the same fonts, however. Another option 
would be PDF or EPS, but that would probably only be convenient for PS 
and/or PDF output.
> Another idea I had while reading Knuth's "TeX: The Program" is to use
> the layout information in the TFM font metric files. Apparently math
> fonts have additional layout information in them, like where to place
> superscripts. I've looked at several tfm parsing implementations, and
> haven't found one yet that actually extracts this information; most
> extract the standard font information but not the special math
> information. But if we could access this info, we could include the
> tfm files for common raster sizes and use the layout info crafted by
> the master himself.
very cool.
> A third possibility would be to support mathml, using some good mathml
> renderer. Is there a good, free mathml rendering library - what does
> mozilla use for this?
good question. That would be nice, too.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: John H. <jdh...@ac...> - 2004年10月26日 16:45:04
>>>>> "Chris" == Chris Barker <Chr...@no...> writes:
 Chris> Gary wrote:
 >> Matplotlib doesn't support \text, and it requires that the
 >> first and last characters of a TeX string be $. I guess it
 >> only processes mathmode. Well, it can't do *everything*.
It is on the goals page (http://matplotlib.sourceforge.net/goals.html)
to support embedded math strings like
 s = r'Mean ($\mu=5) and standard deviation ($\sigma=1$)'
This wouldn't be too hard - just takes some time that I haven't had of
late.
 Chris> Oh well, I've always thought that if you want to support
 Chris> Math in a graphics package, you would actually use TeX,
 Chris> rather than emulating it. Maybe like PyX:
 Chris> http://pyx.sourceforge.net/
Yes, but you lose the platform independence and portability by doing
this. It would be nice to be able to choose one or the other -- see
below.
 Chris> The problem, of course, is that requiring a TeX system is a
 Chris> BIG dependency! It would be nice if one could re-package
 Chris> the Tex interpreter to be embedded. I have no idea how big
 Chris> a job that would be. You'd also have all the font issues,
 Chris> of course, but while that would all be a lot of work, I'm
 Chris> not sure it would be more work than trying to re-write TeX!
It would be a monster job. There is basically no way to factor tex
into components -- it's a monolithic system, in part because of the
heavy use of web macros. And web2c, the conversion of web/pascal to
c, is GPLd and less permissive than the matplotlib license. So
embedding tex is a no-go, aside from size considerations. But there
are some possibilities for improving what matplotlib already offers.
One is to fall back on tex where available as a command line tool (as
pyx does, I believe), and use other command line tools to convert the
dvi to png or some other raster format and then embed it. This would
require a few external libs and utilities, but it's certainly doable.
Another idea I had while reading Knuth's "TeX: The Program" is to use
the layout information in the TFM font metric files. Apparently math
fonts have additional layout information in them, like where to place
superscripts. I've looked at several tfm parsing implementations, and
haven't found one yet that actually extracts this information; most
extract the standard font information but not the special math
information. But if we could access this info, we could include the
tfm files for common raster sizes and use the layout info crafted by
the master himself.
A third possibility would be to support mathml, using some good mathml
renderer. Is there a good, free mathml rendering library - what does
mozilla use for this?
JDH
From: Arnd B. <arn...@we...> - 2004年10月26日 16:23:40
On 2004年10月26日, Chris Barker wrote:
> Gary wrote:
>
> > Matplotlib doesn't support \text, and it requires that the first and
> > last characters of a TeX string be $. I guess it only processes
> > mathmode. Well, it can't do *everything*.
>
> Oh well, I've always thought that if you want to support Math in a
> graphics package, you would actually use TeX, rather than emulating it.
> Maybe like PyX:
>
> http://pyx.sourceforge.net/
>
> The problem, of course, is that requiring a TeX system is a BIG
> dependency! It would be nice if one could re-package the Tex interpreter
> to be embedded. I have no idea how big a job that would be. You'd also
> have all the font issues, of course, but while that would all be a lot
> of work, I'm not sure it would be more work than trying to re-write TeX!
>
> -Chris
OTOH: many people working in science will already have a TeX system
installed, I'd guess.
Another thought: What about an optional PyX back-end for matplotlib?
(If one is interested in really good postscript
output I think PyX is great. Transparency etc.
might be problematic with postscript,
but a combination of postscript lines, symbols and math with bitmapped
graphics should be possible for the PyX back-end).
Best,
Arnd
P.S.: Just to be sure: I am not saying that the postscript
output of matplotlib is bad (Haven't even tested it).
From: Chris B. <Chr...@no...> - 2004年10月26日 16:08:51
Gary wrote:
> Matplotlib doesn't support \text, and it requires that the first and 
> last characters of a TeX string be $. I guess it only processes 
> mathmode. Well, it can't do *everything*. 
Oh well, I've always thought that if you want to support Math in a 
graphics package, you would actually use TeX, rather than emulating it. 
Maybe like PyX:
http://pyx.sourceforge.net/
The problem, of course, is that requiring a TeX system is a BIG 
dependency! It would be nice if one could re-package the Tex interpreter 
to be embedded. I have no idea how big a job that would be. You'd also 
have all the font issues, of course, but while that would all be a lot 
of work, I'm not sure it would be more work than trying to re-write TeX!
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Gary <pa...@in...> - 2004年10月26日 00:40:20
Chris Barker wrote:
> Gary wrote:
>
>> AFAICT, It is not possible to mix text and TeX symbols in a string 
>> and have it come out right. For example, in
>>
>> xlabel(r'$\rm{Normalized Temperature} (kT/\epsilon)$'
>> The text comes out in TeX math mode ... not so pretty. Please tell 
>> me what I've overlooked.
>
>
> well, I'm not sure how this is supported in matplotlib, but in 
> LaTex,you would do:
>
> Normalized Temperature $(kT/\epsilon)$
>
> or:
>
> $\text{Normalized Temperature} (kT/\epsilon)$
>
> the "$" means put it in math mode, if you don't want "Normalized 
> Temperature" in math mode, don't put it inside the $$. The second puts 
> it all in math mode, but the text{} means set this in text mode.
>
> -Chris
>
Matplotlib doesn't support \text, and it requires that the first and 
last characters of a TeX string be $. I guess it only processes 
mathmode. Well, it can't do *everything*. It would be nice to figure 
out a workaround...
thx,
-gary
From: Cory D. <cd...@st...> - 2004年10月25日 18:06:19
Hi there, I tried to install from CVS and got the following error from
an existing script. I haven't looked deeply for the cause because it
seems likely to be something to do with John's post a few days ago.
[cory@fog 050]$ python IQplots.py
Traceback (most recent call last):
 File "IQplots.py", line 2, in ?
 from matplotlib.matlab import *
 File "/eosmls/local/linux/lib/python/matplotlib/matlab.py", line 161,
in ?
 from axes import Axes, PolarAxes
 File "/eosmls/local/linux/lib/python/matplotlib/axes.py", line 9, in ?
 from artist import Artist
 File "/eosmls/local/linux/lib/python/matplotlib/artist.py", line 4, in
?
 from transforms import identity_transform
 File "/eosmls/local/linux/lib/python/matplotlib/transforms.py", line
182, in ?
 from _transforms import IDENTITY, LOG10, POLAR, Func, FuncXY
ImportError: cannot import name POLAR
Cheers,
Cory.
-- 
))))))))))))))))))))))))))))))))))))))))))))
Cory Davis
Meteorology
School of GeoSciences
University of Edinburgh
King's Buildings
EDINBURGH EH9 3JZ
ph: +44(0)131 6505092
fax +44(0)131 6505780
cd...@st...
co...@me...
http://www.geos.ed.ac.uk/contacts/homes/cdavis
))))))))))))))))))))))))))))))))))))))))))))

Showing results of 120

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