SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: John H. <jdh...@ac...> - 2004年04月24日 15:01:37
>>>>> "Flavio" == Flavio Codeco Coelho <fcc...@fi...> writes:
 Flavio> John, The following example works ok with WXAgg (Hoorray!)
 Flavio> but the exponent 4 at the end of the expression does not
 Flavio> show up (with or without brackets).
Yes, there is a bug in the parser for over/under subscripts. I think
I have the fix for it, but haven't been able get it done yet. 
 
 Flavio> Also, an anoying thing is the need for spaces around TeX
 Flavio> markup. The same expression does not get formatted by
 Flavio> mathtext if you remove the spaces. This is going to
 Flavio> confuse TeX users since LaTeX doesn't need spaces.
Yes, at the least a \/ symbol would be nice.
 Flavio> one last thing: after you close the WXAgg figure, the
 Flavio> execution does not return to the interpreter. This does
 Flavio> not happen on GTK.
OK, thanks for letting me know.
JDH
From: david P. <dav...@kc...> - 2004年09月30日 11:36:59
Thanks for previous help.
 
Using 0.63.2 I now cannot render TEX symbols.
Has anyone else done this under Windows?
I appear to have the right Bakoma fonts in D:\Python23\share\matplotlib.
I tried creating the environment variable TTFPATH at the python prompt to
point to this directory but no luck.
 
David
 
 
From: John H. <jdh...@ac...> - 2004年09月30日 14:32:27
>>>>> "david" == david Powell <dav...@kc...> writes:
 david> Thanks for previous help. Using 0.63.2 I now cannot render
 david> TEX symbols.
 david> Has anyone else done this under Windows?
 david> I appear to have the right Bakoma fonts in
 david> D:\Python23\share\matplotlib.
 david> I tried creating the environment variable TTFPATH at the
 david> python prompt to point to this directory but no luck.
Works fine for me on windows XP. Can you run the mathtext_demo.py at
http://matplotlib.sf.net/examples/mathtext_demo.py ?
What backend are you using - tkagg is the default and should be set in
D:\Python23\share\.matplotlibrc according to the info you provided
above.
JDH
 
 
From: david P. <dav...@kc...> - 2004年09月30日 15:22:14
John
Thank you for pointing me to the examples.
It works for me too.
Sorry to raise false alarm.
Regards David
-----Original Message-----
From: John Hunter [mailto:jdh...@ac...] 
Sent: 30 September 2004 14:44
To: david Powell
Cc: mat...@li...
Subject: Re: [Matplotlib-users] mathtext
>>>>> "david" == david Powell <dav...@kc...> writes:
 david> Thanks for previous help. Using 0.63.2 I now cannot render
 david> TEX symbols.
 david> Has anyone else done this under Windows?
 david> I appear to have the right Bakoma fonts in
 david> D:\Python23\share\matplotlib.
 david> I tried creating the environment variable TTFPATH at the
 david> python prompt to point to this directory but no luck.
Works fine for me on windows XP. Can you run the mathtext_demo.py at
http://matplotlib.sf.net/examples/mathtext_demo.py ?
What backend are you using - tkagg is the default and should be set in
D:\Python23\share\.matplotlibrc according to the info you provided
above.
JDH
 
 
From: Steve S. <el...@gm...> - 2006年03月07日 00:57:00
Hi
1)
Using the recent svn version I get axes labels which are partially cut 
off when using mathtext (*no* usetex) and increasing the font size (see 
attached "image_cut.png"):
rcParams['xtick.labelsize'] = 18
rcParams['ytick.labelsize'] = 18
rcParams['axes.labelsize'] = 18
plot([1,2,3])
xlabel(r'$\rm{value}\ \sum\prod\Omega x_i$')
ylabel('y-Titel')
savefig("image_cut.png")
I observed this with .png, jpg and .eps
2)
Is it possible for the "\Omega" in "image_omega.png" to be upright (like 
it would be for usetex=True) and not inclined?
rcParams['xtick.labelsize'] = 18
rcParams['ytick.labelsize'] = 18
rcParams['axes.labelsize'] = 18
plot([1,2,3])
xlabel(r'$\Omega$')
ylabel('y-Titel')
savefig("image_omega.png")
cheers,
steve
-- 
Random number generation is the art of producing pure gibberish as 
quickly as possible.
From: Darren D. <dd...@co...> - 2006年03月07日 03:08:05
On Monday 06 March 2006 7:56 pm, Steve Schmerler wrote:
> Hi
>
> 1)
> Using the recent svn version I get axes labels which are partially cut
> off when using mathtext (*no* usetex) and increasing the font size (see
> attached "image_cut.png"):
>
> rcParams['xtick.labelsize'] = 18
> rcParams['ytick.labelsize'] = 18
> rcParams['axes.labelsize'] = 18
> plot([1,2,3])
> xlabel(r'$\rm{value}\ \sum\prod\Omega x_i$')
> ylabel('y-Titel')
> savefig("image_cut.png")
>
> I observed this with .png, jpg and .eps
As I mentioned for Ryan's question, try manually positioning your axes to 
leave enough room for your axes labels in the figure window.
> 2)
> Is it possible for the "\Omega" in "image_omega.png" to be upright (like
> it would be for usetex=True) and not inclined?
>
> rcParams['xtick.labelsize'] = 18
> rcParams['ytick.labelsize'] = 18
> rcParams['axes.labelsize'] = 18
> plot([1,2,3])
> xlabel(r'$\Omega$')
> ylabel('y-Titel')
> savefig("image_omega.png")
I have to punt, I dont know the answer to this one.
Darren
From: John H. <jdh...@ac...> - 2006年03月07日 14:24:27
>>>>> "Darren" == Darren Dale <dd...@co...> writes:
 Darren> As I mentioned for Ryan's question, try manually
 Darren> positioning your axes to leave enough room for your axes
 Darren> labels in the figure window.
Yep. We don't use any smarts to make sure text doesn't get clipped
off the bottom. Raise the bottom of your subplot by adjusting the
"bottom" of the subplot params
figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure
You can either adjust the rc param, or use the subplots_adjust command
See examples ganged_plots.py and subplots_adjust.py
 >> 2) Is it possible for the "\Omega" in "image_omega.png" to be
 >> upright (like it would be for usetex=True) and not inclined?
It probably is possible. Does TeX not use an italicized \Omega in
math mode?
JDH
From: steve s. <me...@gm...> - 2006年03月07日 18:58:31
John Hunter wrote:
>>>>>>"Darren" == Darren Dale <dd...@co...> writes:
> 
> 
> Darren> As I mentioned for Ryan's question, try manually
> Darren> positioning your axes to leave enough room for your axes
> Darren> labels in the figure window.
> 
> Yep. We don't use any smarts to make sure text doesn't get clipped
> off the bottom. Raise the bottom of your subplot by adjusting the
> "bottom" of the subplot params
> 
> figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure
> 
> You can either adjust the rc param, or use the subplots_adjust command
> 
> See examples ganged_plots.py and subplots_adjust.py
> 
Hmmm OK, I'll have a look. Thanks.
> >> 2) Is it possible for the "\Omega" in "image_omega.png" to be
> >> upright (like it would be for usetex=True) and not inclined?
> 
> It probably is possible. Does TeX not use an italicized \Omega in
> math mode?
> 
No, all capital greek letters are upright.
cheers,
steve
From: John H. <jdh...@ac...> - 2006年03月07日 20:41:38
>>>>> "steve" == steve schmerler <me...@gm...> writes:
 steve> No, all capital greek letters are upright.
This looks like a mathtext bug then. To fix it, you need to update
the entries in _mathtext_data.py. In that file there is a dictionary 
mapping symbol names to fontnames, glyphindex, eg for \Omega
 r'\Omega' : ('cmmi10', 23),
as you can see, we are pulling it from the italics file. What you
need to do is find out which cm* font file contains the Omega you
want, and what the glyph index of Omega is. There is a comment in the
_mathtext_data file that gives some guidance, namely
# this dict maps symbol names to fontnames, glyphindex. To get the
# glyph index from the character code, you have to use a reverse
# dictionary grom font.get_charmaps, eg,
"""
from matplotlib.ft2font import FT2Font
font = FT2Font('/usr/lib/python2.4/site-packages/matplotlib/mpl-data/cmr10.ttf')
codes = font.get_charmap().items()
rd = dict([(charcode, glyphind) for glyphind,charcode in codes])
items = rd.items()
items.sort()
for charcode, glyphind in items:
 print charcode, glyphind
"""
So if you know the character code of the glyph you want, you can use
this code to get the right glyph index.
If you would like to take a stab at fixing these for the upper case
greek letters, that would be great.
Thanks,
JDH
From: Jouni K S. <jk...@ik...> - 2006年03月09日 15:27:09
John Hunter <jdh...@ac...> writes:
> What you need to do is find out which cm* font file contains the
> Omega you want, and what the glyph index of Omega is.
The simple way to do this is to write a TeX file like
 \documentclass{article}
 \pagestyle{empty}
 \begin{document}
 $\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega$
 \end{document}
run it through LaTeX and then do dvitype -output-level=2 foo.dvi,
which reveals the font and the codes:
 114: fntdef1 7: cmr10---loaded at size 655360 DVI units
 135: fntnum7
 136: setchar0
 137: setchar1
 138: setchar2
 139: setchar3
 140: setchar4
 141: setchar5
 142: setchar6
 143: setchar7
 144: setchar8
 145: setchar9
 146: setchar10
So the upper-case non-slanted Greek letters occupy the first 11
positions of cmr10. For the letters not listed, I guess you are
supposed to use the similar-looking Latin letters.
-- 
Jouni
From: Steve S. <el...@gm...> - 2006年03月17日 02:11:34
Attachments: _mathtext_data.py
Jouni K Seppanen wrote:
> John Hunter <jdh...@ac...> writes:
> 
> 
>>What you need to do is find out which cm* font file contains the
>>Omega you want, and what the glyph index of Omega is.
> 
> 
> The simple way to do this is to write a TeX file like
> 
> \documentclass{article}
> \pagestyle{empty}
> \begin{document}
> $\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega$
> \end{document}
> 
> run it through LaTeX and then do dvitype -output-level=2 foo.dvi,
> which reveals the font and the codes:
> 
> 114: fntdef1 7: cmr10---loaded at size 655360 DVI units
> 135: fntnum7
> 136: setchar0
> 137: setchar1
> 138: setchar2
> 139: setchar3
> 140: setchar4
> 141: setchar5
> 142: setchar6
> 143: setchar7
> 144: setchar8
> 145: setchar9
> 146: setchar10
> 
> So the upper-case non-slanted Greek letters occupy the first 11
> positions of cmr10.
Not exactly I think. Although I'm not at all familiar with font libs 
stuff & friends I found that the correct mappings aren't the 1st 10 
positions in cmr10 (assuming that <number> in a dict entry like
r'\Sigma' : ('cmr10', <number>)
is the position). Anyway, one has to take the
characters from cmr10, not cmmi10. Attached is the _mathtext_data.py 
that selects the non-slanted uppercase greek letters. I removed \Upsilon 
since it's an ordinary "Y" (just like e.g. "X" for \Chi).
cheers,
steve
-- 
Random number generation is the art of producing pure gibberish as 
quickly as possible.
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 によって変換されたページ (->オリジナル) /