S=E6l !
I have been developing a small interface based on matlpotlib. I must say I =
really enjoy it.
I came to the point of a lot of small questions, not found in the FAQ
I am using matplotlib 0.50e on RedHat 9.0 linux and mainly the object picke=
r class
- I have 2 Suplots on top of each other, but when I select only one axis on=
the drop-down button I get an error:
Traceback (most recent call last):
File "/usr/lib/python2.2/site-packages/matplotlib/backends/backend_gtk.py=
", line 987, in toggled
if item=3D=3DitemAll:
NameError: free variable 'itemAll' referenced before assignment in enclosin=
g scope
- I want to systematically disable the vertical zoom/move on the second sub=
plot, but not the first. How can I do that ?
- How can I activate a tooltip on top of my plots ?
- I cannot zoom or move an plot I set the axis ticks to , ie ax.set_xticks(=
[])
- How could I add a button to directly print out the picture in the toolbar=
?
- Is there any density plot available ?
- Can I change the size taken by each of the Suplots ?=20
- I have MANY small plots on my graph. Is there a cost effective way to fil=
ter which plots to show ?
Thanks a lot for this great library !
Kve=F0ja
Jean-Baptiste
=09
--=20
-----------------------------
Jean-Baptiste.Cazier@...
Department of Statistics
deCODE genetics Sturlugata,8
570 2993 101 Reykjav=EDk

I suggest to John a while back that for plotting it makes more sense for
data ranges to be inclusive
[] or min <= x <= max
rather than half-inclusive
[) or min <= x < max
as is the python default for functions like range().
Specifically, what about making the default behaviour to clip the data at
the first point which is equal or greater than the axis range? That should
maintain the efficiency gains of clipping, while still keeping the
scientific plotting behaviour that I think most users are accustomed to.
Cheers,
Matthew.

>>>>> "James" == James Boyle <boyle5@...> writes:
James> I set the axis bounds when I am plotting a number of lines
James> some of which have a larger domain. While interested in the
James> behaviour in the limited domain, I would like to retain the
James> information that some lines extend beyond. When I first
James> encountered this behaviour, I thought that I had mistakenly
James> truncated my input data - I think that the plot should show
James> as much of the data passed to it as possible.
James> Is there something I am missing - or is this a feature?
It's a feature!
matplotlib does two kinds of clipping: data clipping and viewport
clipping. Viewport clipping is the typical clipping where the lines
are clipped to the viewport. data clipping throws out all points not
in the viewport.
I work with very long data sets of which only a small portion is in
the viewport, and use the interactive navigation controls to scroll
trough it. I found it was much more efficient to first clip the data
with Numeric before plotting it. See examples/stock_demo.py, of which
only a few days of 60 days of data are initially in the viewport.
You can control this in a couple of ways:
from matplotlib.matlab import *
ax = subplot(111)
line1, line2 = plot([1,2,3,4],'bo', [1,2,3,4],'k')
line1.set_data_clipping(False)
line2.set_data_clipping(False)
axis([0.,2.4,1.,4.])
show()
Or edit the init function of lines.Line2D to turn data clipping off by
default
self._useDataClipping = False
I've been meaning to make a matplotlibrc file to control things like
default line width, color, fontsize and name, antialiasing, data
clipping and so on.
JDH

If I set the axis limits to a value less than the actual domain of the
data, the line is not extended to the edge of the plot but rather is
only drawn to the final point within the domain. The following
illustrates what I mean:
ax = subplot(111)
plot([1,2,3,4],'bo', [1,2,3,4],'k')
axis([0.,2.4,1.,4.])
The plot stops at the point (2,3) although the data go to (3,4). When I
have dealt with these issues, I usually draw the line to its full
extent and then clip the line so it stops at the edge of the plot
frame.
I set the axis bounds when I am plotting a number of lines some of
which have a larger domain. While interested in the behaviour in the
limited domain, I would like to retain the information that some lines
extend beyond.
When I first encountered this behaviour, I thought that I had
mistakenly truncated my input data - I think that the plot should show
as much of the data passed to it as possible.
Is there something I am missing - or is this a feature?
JIm

> >>>>> "Gary" == Gary Pajer <pajer@...> writes:
>
> Gary> If I start interactive2.py, it complains that ShowOn can't
> Gary> be imported. Sure enough, there seems to be no method
> Gary> ShowOn. Or at least I can't find it. Consequently
> Gary> interactive2.py loses it's charm :)
>
> Gary> Or have I misunderstood something?
>
> You are using an out-of-date interactive2.py. Matplotlib recently
> changed (improved!) the way it sets the interactive flags. You have
> the new matplotlib module and the old interactive2.py code. Grab
> the latest *.tar.gz or *.zip and use examples/interactive2.py from
> that code.
>
> Should help,
> JDH
Yes, thank you.

On Feb 23, 2004, at 9:16 AM, John Hunter wrote
>
> Perhaps a better solution is to allow keyword args to the plot command
>
> plot(datar, -1.0*pr, 'b',
> linewidth=0.2, label='a red line', alpha=0.2)
>
> This could be extended to handle plot multiple plots with one command
> as follows
>
> plot(x1, y1, 'b', x2, y2, 'r--',
> linewidth=(2,3), label=('a blue line', 'a red line'),
> alpha=(1.0,0.5), antialiased = (True,False))
>
I strongly agree with the kwargs approach, it makes things clear as to
what is being set.
> Just an oversight on my part - I've been adding these neglected
> accessor methods as people need them. The axes border is a
> patches.Rectangle instance. If you add the following accessor method
> to class Axes (on or around line 598)
>
> def get_frame(self):
> "Return the axes Rectangle frame"
> return self._axesPatch
> from matplotlib.matlab import *
> ax = subplot(111)
> plot([1,2,3])
> frame = ax.get_frame()
> frame.set_linewidth(3.0)
> frame.set_facecolor('r')
> frame.set_edgecolor('y')
> show()
I applied this patch and it worked fine. On my Mac I use the PS
backend and convert to PDF. With the default frame width (0.5), the
frame was not visible using Adobe Reader 6.0. The file printed fine,
but the on screen viewing omitted the frame. This might be a personal
problem on my setup, but it might be useful if other people have this
difficulty. Making the frame width equal to 1 fixes things.
using matplotlib and lovin' it.
Jim

>>>>> "James" == James Boyle <boyle5@...> writes:
James> I would like to be able to change the width of a line. If
James> I just use B/W the use of line widths and styles can
James> differentiate a number of lines. Currently, I do this: p =
James> plot(datar,-1.0*(pr),'b') p.extend(
James> plot(datac,-1.0*(pc),'r--')) p[0].set_linewidth(2)
James> p[1].set_linewidth(3)
James> Is this the way to do this? or is there something more
James> elegant.
I guess beauty is in the eye of the beholder, but I find this more
elegant
liner, linec = plot(datar, -1.0*pr, 'b',
datac, -1.0*pc, 'r--')
liner.set_linewidth(2)
linec.set_linewidth(3)
James> It might be useful for the third argument to have color,
James> style and width.
It's certainly doable, but my hesitancy in doing this is that there
are a lot of properties of a line that one could make an argument for
putting in the format string. matthew suggested allowing a label as
in 'r--;red line' (ala octave). Should the alpha property be in
there? My inclination is to follow the python design philosophy of
"one obvious way to do it".
Perhaps a better solution is to allow keyword args to the plot command
plot(datar, -1.0*pr, 'b',
linewidth=0.2, label='a red line', alpha=0.2)
This could be extended to handle plot multiple plots with one command
as follows
plot(x1, y1, 'b', x2, y2, 'r--',
linewidth=(2,3), label=('a blue line', 'a red line'),
alpha=(1.0,0.5), antialiased = (True,False))
legend can be altered to use line labels if they exist, so you could
build the legend of this plot just by callinging
legend()
I find this the kwargs approach a little cleaner than having a
mother-of-all-format-strings.
James> I have not been able to figure out how to change the line
James> thickness of the axis frame, i.e. the x and y axis
James> themselves. There are examples for the grid, if one is
James> used, and the tick marks but not the frame itself.
Just an oversight on my part - I've been adding these neglected
accessor methods as people need them. The axes border is a
patches.Rectangle instance. If you add the following accessor method
to class Axes (on or around line 598)
def get_frame(self):
"Return the axes Rectangle frame"
return self._axesPatch
I just added it to the src tree. You can then control the axes
rectangle as well, as in this example
from matplotlib.matlab import *
ax = subplot(111)
plot([1,2,3])
frame = ax.get_frame()
frame.set_linewidth(3.0)
frame.set_facecolor('r')
frame.set_edgecolor('y')
show()
Hope this helps,
JDH

I would like to be able to change the width of a line. If I just use
B/W the use of line widths and styles can differentiate a number of
lines. Currently, I do this:
p = plot(datar,-1.0*(pr),'b')
p.extend( plot(datac,-1.0*(pc),'r--'))
p[0].set_linewidth(2)
p[1].set_linewidth(3)
Is this the way to do this? or is there something more eleganf. It
might be useful for the third argument to have color, style and width.
I have not been able to figure out how to change the line thickness of
the axis frame, i.e. the x and y axis themselves. There are examples
for the grid, if one is used, and the tick marks but not the frame
itself.
Thanks for any help.
Jim

>>>>> "katrin" == katrin schenk <schenk@...> writes:
katrin> C:\GTK\lib and C:\GTK\include to the path
^^^
should be C:\GTK\bin.
Also make sure you have no spaces in other entries in your path.
Correcting your PATH will probably cure you, but if you still have
troubles you should read the FAQ entry "I cannot import gtk / gdk /
gobject" at http://matplotlib.sourceforge.net/faq.html and if you
still are having trouble after trying what is suggested there and
reading the links, you may want to consider using the wx backend.
http://matplotlib.sourceforge.net/backends.html#WX
Sorry you're having so much trouble; don't give up hope!
JDH

Hi again,
I have given up on installing matplotlib on linux for now, i have to
upgrade my mandrake install anyway, then I will try again. Now I have an
issue with installing matplotlib with gtk on my windows 2000 partition:
I followed the instructions on the web page to the letter:
installed python23
installed pygtk2.0
installed gtk in C:\GTK
added C:\GTK\lib and C:\GTK\include to the path
installed matplotlib
For a test i ran:
import pygtk
pygtk.require('2.0')
import gtk
At this point i get a system error telling me that the dynamic link
library libglib-2.0-0.dll could not be found on my path. This makes sense
since there IS no file libglib-2.0-0.dll in the GTK install, only a file
called libglib-2.0.dll.a
What is going on? What have I done wrong?
Any help would be appreciated greatly!
katrin

>>>>> "Gary" == Gary Pajer <pajer@...> writes:
Gary> If I start interactive2.py, it complains that ShowOn can't
Gary> be imported. Sure enough, there seems to be no method
Gary> ShowOn. Or at least I can't find it. Consequently
Gary> interactive2.py loses it's charm :)
Gary> Or have I misunderstood something?
You are using an out-of-date interactive2.py. Matplotlib recently
changed (improved!) the way it sets the interactive flags. You have
the new matplotlib module and the old interactive2.py code. Grab
the latest *.tar.gz or *.zip and use examples/interactive2.py from
that code.
Should help,
JDH

If I start interactive2.py, it complains that ShowOn can't be imported.
Sure enough, there seems to be no method ShowOn. Or at least I can't find
it. Consequently interactive2.py loses it's charm :)
Or have I misunderstood something?
-gary
WinXP, python 2.3.3, matplotlib 5.0, GTK 2.2.4.1

>>>>> "katrin" == katrin schenk <schenk@...> writes:
katrin> Hi all, I am DESPERATE to use matplotlib on my linux
katrin> box...Here is the problem, according to my linux box,
katrin> Gtk+2.0 and the corresponding libgtk developer tools are
katrin> installed. However, when I try to configure pygtk2.0
katrin> (needed by matplotlib) I get an error saying that gtk+2.0
katrin> is not installed, (I also tried (foolishly) to run a
katrin> matplotlib example file with a gtk backgroud and got a
katrin> "gobject missing" error). Has anyone else had a problem
katrin> like this? Anyone know how to fix?
Hi Katrin,
I saw that you were already getting some good suggestions on the pygtk
list, which I also read. Those are the same things I would suggest
too: try an rpm, if not, make sure your pkgconfig for pygtk is updated
eg, what doed the following reveal?
localhost:~> pkg-config --modversion gtk+-2.0
2.2.1
Even if your RPM installed them, if pkgconfig cannot find them, you'll
have install troubles. You can set the path pkgconfig uses to find
files, eg,
setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/usr/lib/pkgconfig
In this case, you want to make sure the file gtk+-2.0.pc is in your
PKG_CONFIG_PATH path.
But these are all fallback suggestions if the rpm doesn't work for
you. If you have more trouble, it will help also to provide the exact
compiler error.
Good luck. If you figure out what was going wrong and fix it, let me
know and I'll update the website docs.
JDH

Hi all,
I am DESPERATE to use matplotlib on my linux box...Here is the problem,
according to my linux box, Gtk+2.0 and the corresponding libgtk developer
tools are installed. However, when I try to configure pygtk2.0 (needed by
matplotlib) I get an error saying that gtk+2.0 is not installed, (I
also tried (foolishly) to run a matplotlib example file with a gtk
backgroud and got a "gobject missing" error). Has anyone else had a
problem like this? Anyone know how to fix?
katrin

>>>>> "David" == David ASN <asndav@...> writes:
David> Hi all, I'm starting to get in matlabplot world :-D Before
David> it I tried chaco but it doesn't work in Linux, so I want to
David> try this. I'm trying to develope an oscilloscope and I
David> need it to embed it into a wx application. i was thinking
David> in derive a class from wxScrolledWindow and create a Figure
David> inside, is it possible?
Is certainly possible. Have you looked at examples/anim.py and
examples/system_monitor.py? These use GTK, but will show you how to
dynamically update your figure. Both WX and GTK have a mainloop,
which probably means you need to define an update function that
updates your plot along the lines of system_monitor, and then pass
that function to an idle handler in wx.
David> I want to know something about the Class Hierarchy in
David> matplotlib, from which class figure derives, which is the
David> 'main' class (Figure, i hope), where is the data stored,...
I assume you are using the latest matplotlib release 0.50. In this
release, there are two important objects for you. The first is
Figure, which is what the figure command creates and it contains all
the axes, plots, etc... This has nothing to do with wx, The second is
FigureCanvasWx. In backend wx, this derives from wxPanel and so is a
wx widget. It contains your figure.
In the matlab interface, you can access all of these attributes as
follows
manager = get_current_fig_manager()
canvas = manager.canvas # in wx mode, this is FigureCanvasWx
figure = canvas.figure # this is the backend independent Figure instance
In you oscilloscope update function, you will probably want to do
something along the lines of
lines = plot(t, y) # the initial plot at time 0
line = lines[0] # a matplotlib.lines.Line2D instance
def update_scope(*args):
# get a new t, y
line.set_data(t, y)
canvas.draw()
# this is a made up function, meaning, tell wx's idle handler to call
# update_scope every 100ms
wx.idle_handler(update_scope, 0.1)
show() # enter the wx mainloop
You don't need to use the matlab interface at all - you can work
directly with the wx widgets if you prefer. See
examples/embedding_in_wx.py
If you run into more trouble, post some code back here and someone can
probably help you out.
Good luck,
JDH

>>>>> "Dominique" == Dominique Orban <do@...> writes:
Dominique> Hi, far from being a font expert, let alone PostScript,
Dominique> i was making experiments with the PS backend in
Dominique> Matplotlib. In SuSE Linux 8.0, i set my AFMPATH to
Dominique> point to TeX and GhostScript directories containing
Dominique> tons of afm font files.
Hi Dominique,
Thanks for the fix. Could you send me your updated backend_ps.py. It
will be easiest for me to merge in your changes that way. Is it slow
for you to load backend_ps. If you have a lot of font files, I assume
it can take a while to parse them all. It might be useful to cache
this information in the way that ttfquery does...
JDH

Hi, far from being a font expert, let alone PostScript,
i was making experiments with the PS backend in Matplotlib.
In SuSE Linux 8.0, i set my AFMPATH to point to TeX and
GhostScript directories containing tons of afm font files.
I notice that my whole AFMPATH is parsed for font files.
At some point, the parser is in a subdirectory
containing TeX font files, named 'public'. After fiddling
a little, i remarked that these font files have a
'EncodingScheme' field with an empty value.
The parser breaks on such a file, when it executes
line.split():
File "/usr/local/lib/python2.3/site-packages/matplotlib/afm.py", line 101, in _parse_header
key, val = line.split(' ', 1)
ValueError: unpack list of wrong size
The font files are called
anttb.afm anttr.afm anttri.afm
and come standard with LaTeX2e.
There may be others. I just wanted to bring to your attention that
there may be afm files with that field empty, which causes your
parser to break.
Similarly, some (TeX) afm font files have 'Characters' and
'Capheight' fields with integer values.
I could fix all this by editing afm.py and adding the two lines
'Characters': _to_int,
'Capheight': _to_int,
to the initialization of headerConverters in _parse_header(),
and the lines
lst = line.split( ' ', 1 )
key = lst[0]
if len( lst ) == 2:
val = lst[1]
else:
val = ''
to replace line 100 :
key, val = line.split(' ', 1)
Otherwise, all works very nicely and i am most impressed with the
quality of the plots produced by Matplotlib. Congratulations.
Dominique

Hi all, I'm starting to get in matlabplot world :-D
Before it I tried chaco but it doesn't work in Linux, so I want to try this.
I'm trying to develope an oscilloscope and I need it to embed it into a wx
application. i was thinking in derive a class from wxScrolledWindow and
create a Figure inside, is it possible?
I want to know something about the Class Hierarchy in matplotlib, from which
class figure derives, which is the 'main' class (Figure, i hope), where is
the data stored,...
Best Regards,
David Asensio Ortega
asndav@...
_________________________________________________________________
Encuentra a tu media naranja entre los perfiles que más te gusten. Toda la
magia del romance en MSN Amor & Amistad. http://match.msn.es/

Hi
Great to see another release with lots of improvements. Motivated by your
new FAQ and the web page about interactive usage, I tried interactive.py
again.
The good news is I got it to work and it looks very handy indeed. It has
autocomplete! Yay!
The bad news is it didn't work first go (and I think this is why I didn't
try it out earlier):
~/downloads/matplotlib/examples$ ./interactive.py
: No such file or directory
The above fails, but the below works. I tried changing the first line from
#!/usr/bin/env python
to
#!/usr/bin/python
But it didn't help, even though that works on other scripts of mine. But
the below works:
~/downloads/matplotlib/examples$ python ./interactive.py
['./interactive.py']
Welcome to matplotlib.
help(matlab) -- shows a list of all matlab compatible commands
provided
help(plotting) -- shows a list of plot specific commands
>> plot([1, 2, 3])
[<matplotlib.lines.Line2D instance at 0x8399054>]
Interactive use easily justifies me wrapping this with a script so I can
jump into it easily form the command line, but I thought this might affect
other people trying interactive.py for the first time. I'm not quite sure
how to debug the problem. I'm using bash under Linux by the way.
m.

>>>>> "Jorgen" == Jorgen Bergstrom <jorgen@...> writes:
Jorgen> Hi, I just discovered matplotlib, it seems really cool &
Jorgen> just what I have been looking for.
Jorgen> I have a hopefully simple question: How can I change the
Jorgen> font size and type of the legend, and how can I remove the
Jorgen> frame around the legend?
I put the required changes in matplotlib-0.50. See
examples/legend_demo.py for examples of how to change the legend font
properties, turn off the legend frame, control the legend line props,
etc...
JDH

What's new in matplotlib 0.50
Antigrain backend: Agg
Adding to the growing list of image backends is Antigrain --
http://antigrain.com. This is a backend written mostly in extension
code and is the fastest of all the image backends. Agg supports
freetype fonts, antialiased drawing, alpha blending, and much
more. The windows installer contains everything you need except
Numeric to use the agg backend out of the box; for other platforms
see http://matplotlib.sourceforge.net/backends.html#Agg
Paint/libart backend
David Moore wrote a backend for pypaint, a libart wrapper. libart is
a high quality, cross platform image renderer that supports
antialiased lines, freetype fonts, and other capabilities to soon be
exploited. Thanks David! See
http://matplotlib.sourceforge.net/backends.html#Paint for more
information and install instructions
The Matplotlib FAQ
Matplotlib now has a FAQ -- http://matplotlib.sourceforge.net/faq.html
Alpha channel attribute
All the figure elements now have an alpha attribute to allow
blending and translucency. Not all backends are currenly capable of
supporting alpha - currently only Agg, but Paint should be able to
support this soon - see the scatter screenshot for an example of
alpha at work
http://matplotlib.sourceforge.net/screenshots.html#scatter_demo2
Table class added
John Gill has developed a very nice Table class and table function
that plays well with bar charts and stacked bar charts. See example
code and screenshot table_demo at
http://matplotlib.sourceforge.net/screenshots.html#table_demo
New plot commands cla and clf
Clear the current axes or figure. Useful in interactive plotting
from a python shell
GD module on win32
With much weeping and gnashing of teeth and help from half the
people on this globe, built a gdmodule win32 installer. Special
thanks to Stefan Kuzminski for putting up with my endless windows
confusions. See the win32 quickstart at installing the GD backend -
http://matplotlib.sourceforge.net/backends.html#GDWIN32
GD supports clipping and antialiased line drawing
See instructions about upgrading gd and gdmodule at Installing the
GD backend. The line object has a new 'antialiased' property, that
if True, the backend will render the line antialiased if
supported. Note antialiased drawing under GD is slow, so be sure to
turn the property off set(lines, 'antialiased', False) if you
experience performance problems. If you need performance and
antialiasing, use the agg backend.
Wild and wonderful bar charts
You can provide an optional argument bottom to the bar command to
determine where the bottom of each bar is, default 0 for all. This
enables stacked bar plots and candelstick plots --
examples/bar_stacked.py. Thanks to David Moore and John Gill for
suggestions and code.
Figure backend refactored
The figure functionality was split into a backend independent
component Figure and a backend dependent component
FigureCanvasBase. This completes the transition to a totally
abstract figure interface and improves the ability the switch
backends and a figure to multiple backends. See API_CHANGES for
information on migrating applications to the new API at
http://matplotlib.sourceforge.net/API_CHANGES
Tons of bug fixes and optimizations detailed at
http://matplotlib.sourceforge.net/whats_new.html

>>>>> "Jorgen" == Jorgen Bergstrom <jorgen@...> writes:
Jorgen> Hi, I just discovered matplotlib, it seems really cool &
Jorgen> just what I have been looking for.
Jorgen> I have a hopefully simple question: How can I change the
Jorgen> font size and type of the legend, and how can I remove the
Jorgen> frame around the legend?
Hi Jorgen,
Right now there are no nice functions to access the attributes of the
legend, though they will be easy to add. Basically, we need things
like
leg = axes.get_legend() # return the axes Legend instance
and
leg.get_texts() # return the Text instances in the legend
leg.get_lines() # return the Line2D instances in the legend
leg.get_patches()# return the Patch instance in the legend
leg.get_frame() # return the Rectangle bounding box
leg.draw_frame(False)
Here is some code that accesses the attributes directly. Not elegant,
but may get you what you want until proper accessor methods are added
Eg, in legend_demo, you could write
texts = gca()._legend._texts
set(texts, 'fontsize', 14) # use big fonts for the legend text
set(texts, 'fontname, 'courier') # change the fontname
box = gca()._legend._patch # the Rectangle instance containing the legend
box.set_facecolor('b') # make the legend frame blue
handles = gca()._legend._handles # the line / patch instance inside the legend
See the Line2D, Text and Patch classes in matplotlib.lines,
matplotlib.text and matplotlib.patches for information on what
attributes you can set for each of these types.
If you want to add the required methods to axes and legend to expose
these attributes, it is not hard -- send me a patch. Otherwise I'll
put it on my list of things to do.
JDH

Hi, I just discovered matplotlib, it seems really cool & just what I have
been looking for.
I have a hopefully simple question: How can I change the font size and type
of the legend, and how can I remove the frame around the legend?
Thanks!
Jorgen

Almost all of the backends (save postscript) either support freetype
or are capable or supporting it. We need a good cross-platform
freetype font finder package. Right now, we have fonttools and
TTFQuery, which get the job done. But they bring a lot of extra
installation overhead.
For the postscript backend, I wrote a standalone AFM parser which has
worked well - the alternative was to require fonttools, which is
larger than all of matplotlib combined. I would like to have the same
for TTF files - a small, free standing module with no extrinsic
dependencies that we can ship with matplotlib.
A introduction to the ttf specification can be found here
http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=IWS-Chapter08.
We don't need much out of these files: things like character sizes,
kerning distances, etc, are already handled by the freetype extension
modules, eg, paint.font (which I also used for agg).
What we need is for someone to identify the relevant *.ttf dirs on the
major platforms (you can extract most of this information from
TTFQuery), and parse enough of the ttf file to get family name, font
style, weight, etc.... You could either pull out the relevant bits
from fonttools and ttfquery or just roll your own. Ideally, you
should be able to take a matplotlib.text.Text instance and returns the
ttf file which is the closest match for you on your system, falling
back on Vera (which ships with matplotlib) as the default.
I notice on
http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=IWS-Chapter08#3054f18b
there is a field for "Postscript name for the font" which would be
nice to incorporate for backend switching (saving PS from GTK,
etc...).
Anyway, it would be a very useful addition to matplotlib, and would
speed the process of standardizing fonts across the backends.
JDH

>>>>> "Noam" =3D=3D Noam Raphael <noamr@...> writes:
Noam> Hello, I just installed matplotlib, and then uninstalled it
Noam> imediately. The reason is that I don't have matlab
Noam> installed, so, as you must know, matplotlib can't do
Noam> anything. The problem is that the simple fact, that you
Noam> need matlab in order to use matplotlib, is not mentioned
Noam> anywhere in the homepage of matplotlib, or in the
Noam> "installing" section. The only thing that is mentioned, is
Noam> that "The existing plotting commands have a high degree of
Noam> Matlab=AE compatibility". This by no means implies that you
Noam> need matlab installed. Please, fix the homepage and make it
Noam> clear!
Hi Noam, thanks for your email. I confess I found it quite amusing.
Where did you get the idea matplotlib requires matlab? It doesn't.
matplotlib is an open source, free, python package that produces
matlab quality graphics, without matlab or any other software that
costs $$ or is distributed under a proprietary license..
It requires, at a minimum, python and Numeric. Both are free and
easily installed on Windows, linux, UNIX and Mac OS X. My guess is
you don't have python installed. If not, and you are on windows, see
the "Win32 Quickstart" section at
http://matplotlib.sourceforge.net/installing.html. You'll also want
to read http://matplotlib.sourceforge.net/backends.html. =20
If you have any more questions, please join the mailing list at
http://lists.sourceforge.net/mailman/listinfo/matplotlib-users.
Please let me know what caused you confusion, because would like to
make the documentation at the website clear.
Noam> Have a good day, Noam
Likewise,
JDH