|
From: John H. <jdh...@ac...> - 2004-10-31 16:55:59
|
>>>>> "Jochen" == Jochen Voss <vo...@se...> writes:
Jochen> Hello, currently I am having a closer look at the
Jochen> PostScript backend. Some questions occurred to me:
Jochen> 1) What is the meaning of 'backend_version'? When should
Jochen> it be increased/changed?
Eg, for gtk this would be the version of pygtk, for wx the version of
wxpython. It is mainly used to provide us diagnositic information to
help when users post problems on the mailing list. If they run with
--debug-helpful, we get the version info. It is not the same as the
matplotlib version, which is reported separately. For PS, it seems
that it should be the PS level that is required (PS level I, level
II). But it could also be 'not applicable'. If you can think of
something that makes sense, use it.
Jochen> 2) Is the following code the correct way to get the
Jochen> matplotlib version for use in a backend file:
Jochen> from matplotlib import __version__ version=__version__
Looks right to me; you could also do
from matplotlib import __version__ as version
Jochen> 3) The draw_lines method checks whether the argument
Jochen> arrays are of the same size as required. The other
Jochen> functions do not do any sanity checks on the arguments.
Jochen> Can the renderer methods assume that they are called with
Jochen> semantically correct arguments? Is it ok to fail with an
Jochen> Python exception otherwise?
Yes on both cases, me thinks.
Jochen> 4) Can the PostScript code assume that each file contains
Jochen> only one picture/page? Might this change in the future?
I say yes. I can't imagine changing this, but perhaps someelse who is
more imaginative than I could.
Jochen> 5) Does matplotlib have the concept of a picture title
Jochen> which could be written into the DSC "%%Title" comment? If
Jochen> the answer is yes: how do I get this title?
Well, there is a figure title and an axes title. It would be easy to
add a renderer method called set_title which is called by figure.draw
and axes.draw. The problem here is that although there *is* a figure
title (see matplotlib.matlab.figtitle) the most common way to set
titles is via matplotlib.matlab.title which sets the title of the
current axes. Hence you could have multiple titles. One solution,
that will work in 95% of the cases, is just to use the first call to
set_title in the renderer and ignore subsequent calls. This will get
the figure title if there is one, and the first axes title if there
isn't.
Jochen> Also I have some questions about the template backend in
Jochen> backend_template.py:
Jochen> 6) The template backend contains the line
Jochen> from matplotlib.transforms import Bbox
Jochen> Does this have any function or should it be removed?
It can be removed.
Jochen> 7) The template backend uses
Jochen> verbose.report('Error: %s'%msg)
Jochen> Should this be 'verbose.report_error' instead?
Yes.
Jochen> Sorry about having so many questions, Jochen --
Thanks!
JDH
|