Dear all,
I've been using PyX for some time for my plots, and I am generally
very satisfied with the results I get.
The only problem I find with PyX is that the interface is perhaps too
low level for an ordinary user, although I am aware that one can use
an intermediate layer that solves this problem (like, e.g., PyXplot or
PyXgraph). I don't know if this criticism makes sense, perhaps the
original role of PyX is to provide a well structured framework to
create EPS and PDF files (which, I think, PyX perfectly does), rather
than to provide a fast, easy-to-use interface for the creation of
these files.
My question is
Is there anything similar to an 'init file' where the user can set
some default values for the axes, stylechangers, etc.?
Some time ago I asked a similar question and the solution I was given
was to define a class like
class AxisReg(axis.painter.regular):
def __init__(self,
labeldist = 0.15 * unit.v_cm,
titledist = 0.15 * unit.v_cm,
outerticklength = axis.painter.ticklength.short,
innerticklength = None,
basepathattrs = [style.linewidth.normal],
tickattrs = [style.linewidth.normal],
labelattrs = [text.size.footnotesize],
titleattrs = [text.size.small],
**kwargs):
axis.painter.regular.__init__(self,
labeldist = 0.15 * unit.v_cm,
titledist = 0.15 * unit.v_cm,
outerticklength =
axis.painter.ticklength.short,
innerticklength = None,
basepathattrs = [style.linewidth.normal],
tickattrs = [style.linewidth.normal],
labelattrs = [text.size.footnotesize],
titleattrs = [text.size.small],
**kwargs)
class AxisRegLik(axis.painter.regular):
def __init__(self,
outerticklength = axis.painter.ticklength.short,
innerticklength = None,
basepathattrs = [style.linewidth.normal],
tickattrs = [style.linewidth.normal],
labelattrs = None,
titleattrs = None,
**kwargs):
axis.painter.regular.__init__(self,
outerticklength =
axis.painter.ticklength.Short,
innerticklength = None,
basepathattrs = [style.linewidth.normal],
tickattrs = [style.linewidth.normal],
labelattrs = None,
titleattrs = None,
**kwargs)
and then use an instance of this class as a painter of the axis:
regular_axis = AxisReg()
notext_axis = AxisNoReg()
x_ax = axis.linear(title="X", painter = regular_axis,
density = x_density, min=x_min, max=x_max)
x_ax_lik = axis.linear(painter = no_text_a, min = x_min, max = x_max)
y_ax = ...
y_ax_lik = ..
...
graph.graphxy(x=x_ax, y=y_ax, x2=x_ax_lik, y2=y_ax_lik,...)
Ok, it is fine, it can be done, but many of us will agree that this is
not an optimal solution. Are there better ways to do this?
Thanks a lot for your attention,
Mico
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user