late evaluation of source range in function
[PyX/mjg.git] / manual / graph.tex
blob507bf6021d0846db955cd8f9f840677ea5aaa11e
1 \chapter{Module graph: graph plotting}
2 \label{graph}
3 \section{Introductory notes}
5 The graph module is considered to be in constant, gradual development.
6 For the moment we concentrate ourself on standard 2d xy-graphs taking
7 all kind of possible specialties into account like any number of axes.
8 Architectural decisions play the most substantial role at the moment
9 and have hopefully already been done that way, that their flexibility
10 will suffice for future usage in quite different graph applications,
11 \emph{e.g.} circular 2d graphs or even 3d graphs. We will describe
12 those parts of the graph module here, which are in a totally usable
13 state already and are hopefully not to be changed later on. However,
14 future developments certainly will cause some incompatibilities. At
15 least be warned: Nobody knows the hole list of things that will break.
16 At the moment, keeping backwards compatibility in the graph module is
17 not at all an issue. Although we do not yet claim any backwards
18 compatibility for the future at all, the graph module is certainly one
19 of the biggest construction sites within \PyX.
21 The task of drawing graphs is splitted in quite some subtasks, which
22 are implemented by classes of its own. We tried to make those
23 components as independend as it is usefull and possible in order to
24 make them reuseable for different graph types. They are also
25 replaceable by the user to get more specialized graph drawing tasks
26 done without needing to implement a hole graph system. A major
27 abstraction layer are the so-called graph coordinates. Their range is
28 generally fixed to $[0;1]$. Only the graph does know about the
29 conversion between these coordinates and the position at the canvas
30 (the graph itself is its canvas, that can be inserted into another
31 canvas). By that, all other components can be reused for different
32 graph geometries. The interfaces between the components are documented
33 in docstrings of interface classes in the source. The interface
34 technique is used for documentation purposes only. For the user, the
35 most important informations (as described in the following) are the
36 parameters of the constructors of the various implementations of those
37 interface. They are documented in docstrings of the constructors of
38 the classes. While effort of clearing and documenting is still in
39 progress, some parts are already nicely documented as you may see by
40 using \verb|pydoc|.
42 \section{Axes}
43 \label{graph:axes}
45 A common feature of a graph are axes. An axis is responsible for the
46 conversion of values to graph coordinates. There are predefined axis
47 types, namely:
48 \begin{center}
49 \begin{tabular}{ll}
50 axis type&description\\
51 \hline
52 \texttt{linaxis}&linear axis\\
53 \texttt{logaxis}&logarithmic axis\\
54 \end{tabular}
55 \end{center}
57 Further axes types are available to support axes splitting and bar
58 graphs (other axes types might be added in the future as well), but
59 they behave quite different from the generic case and are thus
60 described separately below.
62 You may use axes even without a graph, but drawing them along an
63 arbitrary path using the \verb|pathaxis| function. This function takes
64 an path and an axis as its first two arguments and the result can be
65 inserted into a canvas. The optional keyword argument \verb|direction|
66 can be set to \verb|1|(default) or \verb|-1| to place the labels to
67 the right (default) or left side of the path, respectively.
69 \subsection{Axes properties}
71 Global properties of an axis are set as named parameters in the axis
72 constructor. Both, the \verb|linaxis| and the \verb|logaxis|, have the
73 same set of named parameters listed in the following table:
75 \medskip
76 \begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X}
77 argument name&description\\
78 \hline
79 \texttt{title}&axis title\\
80 \texttt{min}&fixes axis minimum; if not set, it is automatically determined, but this might fail, for example for the $x$-range of functions, when it is not specified there\\
81 \texttt{max}&as above, but for the maximum\\
82 \texttt{reverse}&boolean; exchange minimum and maximum (might be used without setting minimum and maximum); if min>max and reverse is set, they cancel each other\\
83 \texttt{divisor}&numerical divisor for the axis partitioning; default: \texttt{1}\\
84 \texttt{suffix}&a suffix to indicate the divisor within an automatic axis labeling\\
85 \texttt{density}&density parameter for the axis partition rating\\
86 \texttt{maxworse}&number of trials with worse tick rating before giving up; default: \texttt{2}\\
87 \texttt{manualticks}&a list of ticks (described below)\\
88 \texttt{painter}&axis painter (described below)\\
89 \texttt{texter}&texter for the axis labels (described below)\\
90 \texttt{parter}&axis partitioner (described below)\\
91 \texttt{rater}&partition rater (described below)\\
92 \end{tabularx}
93 \medskip
95 \subsection{Partitioning of axes}
97 The definition of ticks and labels appropriate to an axis range is
98 called partitioning. The axis partioning within \PyX{} uses rational
99 arithmetics, which avoids any kind of rounding problems to the cost of
100 performance. The class \verb|frac| supplies a rational number. It can
101 be initialized by another \verb|frac| instance, a tuple of integers
102 (called enumerator and denominator), a float (which gets converted
103 into a frac with a finite resolution \verb|floatprecision| of 10
104 digits per default) or a string with infinite precision (like
105 "1.2345e-100" or even "1/3"). However, a partitioning is composed out
106 of a sorted list of ticks, where the class \verb|tick| is derived from
107 \verb|frac| and has additional properties called \verb|ticklevel|,
108 \verb|labellevel|, \verb|label|, and \verb|labelattrs|. When the
109 \verb|ticklevel| or the \verb|labellevel| is \verb|None|, it just
110 means not present, \verb|0| means tick or label, respectively,
111 \verb|1| means subtick or sublevel and so on. When \verb|labellevel|
112 is not \verb|None|, a \verb|label| might be explicitly given, which
113 will get used as the text of that label. Otherwise the axis painter
114 has to create an appropriate text for the label. The \verb|labelattrs|
115 might specify some attributes for the label to be used by the
116 \verb|text| method of an \verb|texrunner| instance.
118 You can pass a list of \verb|tick| instance to the \verb|manualticks|
119 argument of an axis. By that you can place ticks whereever you want.
120 Additionally you can use a partitioner to create ticks appropriate to
121 the axis range. This can be done by manually specifying distances
122 between ticks, subticks and so on. Alternatively there are automatic
123 axis partitioners available, which provide different partitions and
124 the rating of those different partitions by the \verb|rater| become
125 crucial. Note, that you can combine manually set ticks and a
126 partitioner.
128 \subsubsection{Partitioning of linear axes}
130 The class \verb|linpart| creates a linear partition as described by
131 named parameters of the constructor:
133 \medskip
134 \begin{tabularx}{\linewidth}{ll>{\raggedright\arraybackslash}X}
135 argument name&default&description\\
136 \hline
137 \texttt{tickdist}&\texttt{None}&distance between ticks, subticks, etc. (see comment below); when the parameter is \texttt{None}, ticks will get placed at labels\\
138 \texttt{labeldist}&\texttt{None}&distance between labels, sublabels, etc. (see comment below); when the parameter is \texttt{None}, labels will get placed at ticks\\
139 \texttt{labels}&\texttt{None}&set the text for the labels manually\\
140 \texttt{extendtick}&\texttt{0}&allow for a range extention to include the next tick of the given level\\
141 \texttt{extendlabel}&\texttt{None}&as above, but for labels\\
142 \texttt{epsilon}&\texttt{1e-10}&allow for exceeding the range by that relative value\\
143 \end{tabularx}
144 \medskip
146 The \verb|ticks| and \verb|labels| can either be a list or just a
147 single entry. When a list is provided, the first entry stands for
148 the tick or label, respectively, the second for the subtick or
149 sublabel, and so on. The entries are passed to the constructor of a
150 frac instance, e.g. there can be tuples (enumerator, denominator),
151 strings, floats, etc.
153 \subsubsection{Partitioning of logarithmic axes}
155 The class \verb|logpart| create a logarithmic partition. The
156 parameters of the constructor of the class \verb|logpart| are quite
157 simular to the parameters of \verb|linpart| discussed above. Instead
158 of the parameters \verb|tickdist| and \verb|labeldist| the parameters
159 \verb|tickpos| and \verb|labelpos| are present. All other parameters
160 of \verb|logpart| do not differ in comparision to \verb|linpart|. The
161 \verb|tickdist| and \verb|labeldist| parameters take either a single
162 \verb|preexp| instance or a list of \verb|preexp| instances, where the
163 first stands for the ticks (labels), the second for subticks
164 (sublabels) and so on. A \verb|preexp| instance contains a list of
165 \verb|pres|, which are \verb|frac| instances defining some positions,
166 say $p_i$. Furthermore there is a \verb|frac| instance called
167 \verb|exp|, say $e$. Valid tick and label positions are then given by
168 $s^np_i$, where $n$ is an integer.
170 \begin{center}
171 \begin{tabular}{ll}
172 name&values it descibes\\
173 \hline
174 \texttt{pre1exp5}&1 and multiple of $10^5$\\
175 \texttt{pre1exp4}&1 and multiple of $10^4$\\
176 \texttt{pre1exp3}&1 and multiple of $10^3$\\
177 \texttt{pre1exp2}&1 and multiple of $10^2$\\
178 \texttt{pre1exp}&1 and multiple of $10$\\
179 \texttt{pre125exp}&1, 2, 5 and multiple of $10$\\
180 \texttt{pre1to9exp}&1, 2, \dots, 9 and multiple of $10$\\
181 \end{tabular}
182 \end{center}
184 \subsubsection{Automatic partitioning of linear axes}
186 When no explicit axis partitioner is given in the constructor argument
187 \verb|part| of an linear axis, it is initialized with an automatic
188 partitioning scheme for linear axes. This scheme is provided by the
189 class \verb|autolinpart|, where the constructor takes the following
190 arguments:
192 \medskip
193 \begin{tabularx}{\linewidth}{ll>{\raggedright\arraybackslash}X}
194 argument name&default&description\\
195 \hline
196 \texttt{variants}&\texttt{defaultvariants}&list of possible values for the ticks parameter of \texttt{linpart} (labels are placed at the position of ticks)\\
197 \texttt{extendtick}&\texttt{0}&allow for a range extention to include the next tick of the given level\\
198 \texttt{epsilon}&\texttt{1e-10}&allow for exceeding the range by that relative value\\
199 \end{tabularx}
200 \medskip
202 The default value for the argument \verb|variants|, namely
203 \verb|defaultvariants|, is defined as a class variable of
204 \verb|autolinpart| and has the value \texttt{((frac(1, 1), frac(1,
205 2)), (frac(2, 1), frac(1, 1)), (frac(5, 2), frac(5, 4)), (frac(5, 1),
206 frac(5, 2)))}. This implies, that the automatic axis partitioning
207 scheme allows for partitions using (ticks, subticks) with at distances
208 (1, 1/2), (2, 1), (5/2, 5/4), (5, 5/2). This list must be sorted by
209 the number of ticks the entries will lead to. The given fractions are
210 automatically multiplied or divided by 10 in order to fit better to
211 the axis range. Therefore those additional partitioning possibilities
212 (infinte possibilities) must not be given explicitly.
214 \subsubsection{Automatic partitioning of logarithmic axes}
216 When no explicit axis partitioning is given in the constructor
217 argument \verb|part| of an logarithmic axis, it is initialized with an
218 automatic partitioning schemes for logarithmic axes. This scheme is
219 provided by the class \verb|autologpart|, where the constructor takes
220 the following arguments:
222 \medskip
223 \begin{tabularx}{\linewidth}{ll>{\raggedright\arraybackslash}X}
224 argument name&default&description\\
225 \hline
226 \texttt{variants}&\texttt{defaultvariants}&list of pairs with possible values for the ticks and labels parameters of \texttt{logpart}\\
227 \texttt{extendtick}&\texttt{0}&allow for a range extention to include the next tick of the given level\\
228 \texttt{extendlabel}&\texttt{None}&as above, but for labels\\
229 \texttt{epsilon}&\texttt{1e-10}&allow for exceeding the range by that relative value\\
230 \end{tabularx}
231 \medskip
233 The default value for the argument \verb|variants|, namely
234 \verb|defaultvariants|, is defined as a class variable of
235 \verb|autologpart| and has the value:
236 \begin{verbatim}
237 (((pre1exp, pre1to9exp), # ticks & subticks,
238 (pre1exp, pre125exp)), # labels & sublevels
239 ((pre1exp, pre1to9exp), None), # ticks & subticks, labels=ticks
240 ((pre1exp2, pre1exp), None), # ticks & subticks, labels=ticks
241 ((pre1exp3, pre1exp), None), # ticks & subticks, labels=ticks
242 ((pre1exp4, pre1exp), None), # ticks & subticks, labels=ticks
243 ((pre1exp5, pre1exp), None)) # ticks & subticks, labels=ticks
244 \end{verbatim}
245 As for the \verb|autolinaxis|, this list must be sorted by the number
246 of ticks the entries will lead to.
248 \subsubsection{Rating of axes partitionings}
250 When an axis partitioning scheme returns several partitioning
251 possibilities, the partitions are rated by an instance of a rater
252 class provided as the parameter \verb|rater| at the axis constructor.
253 It is used to calculate a positive rating number for a given axis
254 partitioning. In the end, the lowest rated axis partitioning gets
255 used.
257 The rating consists of two steps. The first takes into account only
258 the number of ticks, subticks, labels and so on in comparison to an
259 optimal number. Additionally, the transgression of the axis range by
260 ticks and labels is taken into account. This rating leads to a
261 preselection of possible partitions. In the second step the layout of
262 a partition gets acknowledged by rating the distance of the labels to
263 each other. Thereby partitions with overlapping labels get quashed
264 out.
266 The class \verb|axisrater| implements a rating with quite some
267 parameters specifically adjusted to linear and logarithmic axes. A
268 detailed description of the hole system goes beyond the scope of that
269 manual. Take your freedom and have a look at the \PyX{} source code if
270 you wish to adopt the rating to personal preferences.
272 The overall optimal partition properties, namely the density of ticks
273 and labels, can be easily adjusted by the single parameter
274 \verb|density| of the axis constructor. The rating is
275 adjusted to the default densitiy value of \verb|1|, but modifications
276 of this parameter in the range of 0.5 (for less ticks) to 2 or even 3
277 (for more ticks) might be usefull.
279 \subsection{Creating label text}
281 When a partition is created, the typical situation is that some of the
282 ticks have a \verb|labellevel| not equal to \verb|None| but there is
283 no \verb|label| (a string) defined to be printed at this tick. The
284 task of a \verb|texter| is to create those label strings for a given
285 list of ticks. There are different \verb|texter| classes creating
286 different label strings.
288 \subsubsection{Decimal numbers}
290 The class \verb|decimaltexter| creates decimal labels. The format of
291 the labels can be configured by numerous arguments of the constructor
292 listed in the following table:
294 \medskip
295 \begin{tabularx}{\linewidth}{ll>{\raggedright\arraybackslash}X}
296 argument name&default&description\\
297 \hline
298 \texttt{prefix}&\texttt{""}&string to be inserted in front of the number\\
299 \texttt{infix}&\texttt{""}&string to be inserted between the plus or minus sign and the number\\
300 \texttt{suffix}&\texttt{""}&string to be inserted after the number\\
301 \texttt{equalprecision}&\texttt{0}&forces a common number of digits after the comma\\
302 \texttt{decimalsep}&\texttt{"."}&decimal separator\\
303 \texttt{thousandsep}&\texttt{""}&thousand separator\\
304 \texttt{thousandthpartsep}&\texttt{""}&thousandth part separator\\
305 \texttt{plus}&\texttt{""}&plus sign\\
306 \texttt{minus}&\texttt{"-"}&minus sign\\
307 \texttt{period}&\texttt{r"\textbackslash overline\{\%s\}"}&format string to indicate a period\\
308 \texttt{labelattrs}&\texttt{text.mathmode}&a single attribute or a list of attributes to be added to the labelattrs\\
309 \end{tabularx}
310 \medskip
312 \subsubsection{Decimal numbers with an exponential}
314 The class \verb|exponentialtexter| creates decimal labels with an
315 exponent. The format of the labels can be configured by numerous
316 arguments of the constructor listed in the following table:
318 \medskip
319 \begin{tabularx}{\linewidth}{ll>{\raggedright\arraybackslash}X}
320 argument name&default&description\\
321 \hline
322 \texttt{plus}&\texttt{""}&plus sign for the exponent\\
323 \texttt{minus}&\texttt{"-"}&minus sign for the exponent\\
324 \texttt{mantissaexp}&\texttt{r"\{\{\%s\}\textbackslash cdot10\textasciicircum\{\%s\}\}"}&format string for manissa and exponent\\
325 \texttt{skipexp0}&\texttt{r"\{\%s\}}&format string for manissa, when exponent is \texttt{0}; use \texttt{None} to turn off this feature\\
326 \texttt{skipexp1}&\texttt{None}&as \texttt{skipexp0}, but for exponent \texttt{1}\\
327 \texttt{nomantissaexp}&\texttt{r"\{10\textbackslash\{\%s\}\}"}&format string when skipping a manissa equals 1\\
328 \texttt{minusnomantissaexp}&\texttt{r"\{-1\textbackslash\{\%s\}\}"}&format string when skipping a manstissa equals -1\\
329 \texttt{mantissamin}&\texttt{frac((1, 1))}&minimal value for the mantissa\\
330 \texttt{mantissamax}&\texttt{frac((10, 1))}&maximal value for the mantissa\\
331 \texttt{skipmantissa1}&\texttt{0}&skip mantissa equals 1\\
332 \texttt{skipallmantissa1}&\texttt{1}&skip mantissa when its always 1\\
333 \texttt{mantissatexter}&\texttt{decimaltexter()}&texter for the mantissa\\
334 \end{tabularx}
335 \medskip
337 \subsubsection{Decimal numbers without or with an exponential}
339 The class \verb|defaulttexter| creates decimal labels without or
340 with an exponent. As the name says, its used as the default texter.
341 The texter splits the tick list into two lists, one to be passed to a
342 decimal texter and another to be passed to an exponential texter. This
343 splitting is based on the two properties \verb|smallestdecimal| and
344 \verb|biggestdecimal|. See the following table for all available
345 arguments:
347 \medskip
348 \begin{tabularx}{\linewidth}{ll>{\raggedright\arraybackslash}X}
349 argument name&default&description\\
350 \hline
351 \texttt{smallestdecimal}&\texttt{frac((1, 1000))}&the smallest number (ignoring the sign) where the decimal texter should be used\\
352 \texttt{biggestdecimal}&\texttt{frac((9999, 1))}&as above, but for the biggest number\\
353 \texttt{equaldecision}&\texttt{1}&either use the \texttt{decimaltexter} or the \texttt{exponentialtexter}\\
354 \texttt{decimaltexter}&\texttt{decimaltexter()}&texter withoud an exponential\\
355 \texttt{exponentialtexter}&\texttt{exponentialtexter()}&exponential with an exponential\\
356 \end{tabularx}
357 \medskip
359 \subsubsection{Rational numbers}
361 The class \verb|rationaltexter| creates rational labels. The format of
362 the labels can be configured by numerous arguments of the constructor
363 listed in the following table:
365 \medskip
366 \begin{tabularx}{\linewidth}{ll>{\raggedright\arraybackslash}X}
367 argument name&default&description\\
368 \hline
369 \texttt{prefix}&\texttt{""}&string to be inserted in front of the rational\\
370 \texttt{infix}&\texttt{""}&string to be inserted between the plus or minus sign and the rational\\
371 \texttt{suffix}&\texttt{""}&string to be inserted after the rational\\
372 \texttt{enumprefix}&\texttt{""}&as \texttt{prefix} but for the enumerator\\
373 \texttt{enuminfix}&\texttt{""}&as \texttt{infix} but for the enumerator\\
374 \texttt{enumsuffix}&\texttt{""}&as \texttt{suffix} but for the enumerator\\
375 \texttt{denomprefix}&\texttt{""}&as \texttt{prefix} but for the denominator\\
376 \texttt{denominfix}&\texttt{""}&as \texttt{infix} but for the denominator\\
377 \texttt{denomsuffix}&\texttt{""}&as \texttt{suffix} but for the denominator\\
378 \texttt{plus}&\texttt{""}&plus sign\\
379 \texttt{minus}&\texttt{"-"}&minus sign\\
380 \texttt{minuspos}&\texttt{0}&position of the minus: \texttt{0} -- in front of the fraction, \texttt{1} -- in front of the enumerator, \texttt{-1} -- in front of the denominator\\
381 \texttt{over}&\texttt{r"\{\{\%s\}\textbackslash over\{\%s\}\}"}&format string for the fraction\\
382 \texttt{equaldenom}&\texttt{0}&usually, the enumerator and the denominator are canceled; if set, take the least common multiple of all denominators\\
383 \texttt{skip1}&\texttt{1}&skip printing the fraction for \texttt{1} when there is a \texttt{prefix}, \texttt{infix}, or \texttt{suffix}\\
384 \texttt{skipenum0}&\texttt{1}&print \texttt{0} instead of a fraction when the enumerator is 0\\
385 \texttt{skipenum1}&\texttt{1}&as \texttt{skip1} but for the enumerator\\
386 \texttt{skipdenom1}&\texttt{1}&skip the denominator when it is \texttt{1} and there is no \texttt{denomprefix}, \texttt{denominfix}, or \texttt{denomsuffix}\\
387 \texttt{labelattrs}&\texttt{text.mathmode}&a single attribute or a list of attributes to be added to the labelattrs\\
388 \end{tabularx}
389 \medskip
391 \subsection{Painting of axes}
393 A major task for an axis is its painting. It is done by instances of
394 \verb|axispainter|, provided to the constructor of an axis as its
395 \verb|painter| argument. The constructor of the axis painter receives
396 a numerous list of named parameters to modify the axis look. A list of
397 parameters is provided in the following table:
399 \medskip
400 \begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X}
401 argument name&description\\
402 \hline
403 \texttt{innerticklengths}$^{1,4}$&tick length of inner ticks (visual length);\newline default: \texttt{axispainter.defaultticklengths}\\
404 \texttt{outerticklengths}$^{1,4}$&as before, but for outer ticks; default: \texttt{None}\\
405 \texttt{tickattrs}$^{2,4}$&stroke attributes for ticks; default: \texttt{()}\\
406 \texttt{gridattrs}$^{2,4}$&stroke attributes for grid paths; default: \texttt{None}\\
407 \texttt{zeropathattrs}$^{3,4}$&stroke attributes for a grid path at axis value 0; default: \texttt{()}\\
408 \texttt{basepathattrs}$^{3,4}$&stroke attributes for the axis base path;\newline default: \texttt{canvas.linecap.square}\\
409 \texttt{labeldist}&label distance from axis (visual length); default: \texttt{"0.3 cm"}\\
410 \texttt{labelattrs}$^{2,4}$&text attributes for labels;\newline default: \texttt{(text.halign.center, text.vshift.mathaxis)}\\
411 \texttt{labeldirection}$^4$&relative label direction (see below); default: \texttt{None}\\
412 \texttt{labelhequalize}&set width of labels to its maximum (boolean); default: \texttt{0}\\
413 \texttt{labelvequalize}&set height and depth of labels to their maxima (boolean); default: \texttt{1}\\
414 \texttt{titledist}&title distance from labels (visual length); default: \texttt{"0.3 cm"}\\
415 \texttt{titleattrs}$^{3,4}$&text attributes for title; default: \texttt{(text.halign.center, text.vshift.mathaxis)}\\
416 \texttt{titledirection}$^4$&relative title direction (see below);\newline default: \texttt{paralleltext}\\
417 \texttt{titlepos}&title position in graph coordinates; default: \texttt{0.5}\\
418 \end{tabularx}
419 \medskip
421 $^1$
422 The parameter should be a list, where the entries are attributes
423 for the different levels. When the level is larger then the list
424 length, \verb|None| is assumed. When the parameter is not a list,
425 it is applied to all levels.\\
426 $^2$
427 The parameter should be a list of lists, where the entries are
428 attributes for the different levels. When the level is larger then the
429 list length, \verb|None| is assumed. When the parameter is not a
430 list of lists, it is applied to all levels.\\
431 $^3$
432 The parameter should be a list. When the parameter is not a
433 list, the parameter is interpreted as a list with a single
434 entry.\\
435 $^4$
436 The feature can be turned off by the value \verb|None|. Within
437 lists or lists of lists, the value \verb|None| might be
438 used to turn off the feature for some levels selectively.
439 \medskip
441 Relative directions for labels (\verb|labeldirection|) and titles
442 (\verb|titledirection|) are instances of \verb|rotatetext|. By that
443 the text direction is calculated relatively to the tick direction of
444 the axis and is added as an attribute of the text. The relative
445 direction provided by instances of the class \verb|rotatetext| prevent
446 upside down text by flipping it by 180 degrees. For convenience, the
447 two self-explanatory values \verb|rotatetext.parallel| and
448 \verb|rotatetext.orthogonal| are available, which are just instances of
449 rotatetext initializes by \verb|-90| degree and \verb|0|,
450 respectively.
452 \subsection{Linked axes}
454 Linked axes can be used whenever an axis should be repeated within a
455 single graph or even between different graphs although the intrinsic
456 meaning is to have only one axis plotted several times. Almost all
457 properties of a linked axis are supplied by the axis it is linked to
458 (you may call it the base axis), but some properties and methods might
459 be different. For the typical case (implemented by \verb|linkaxis|)
460 only the painter of the axis is exchanged together with some
461 simplified behaviour when finishing the axis (there is no need to
462 recalculate the axis partition etc.). The constructor of
463 \verb|linkaxis| takes the axis to be linked to as the first parameter
464 and in the named parameter \verb|painter| a new painter for the axis.
465 By default, \verb|linkaxispainter| is used, which differs from the
466 standard \verb|axispainter| by some default values for the arguments
467 only. Namely, the arguments \verb|zeropathattrs|, \verb|labelattrs|,
468 and \verb|titleattrs| are set to \verb|None| turing off these
469 features.
471 The standard \verb|linkaxis| can be used for a \verb|linaxis| or
472 \verb|logaxis|, other axes might have different \verb|linkaxis|
473 classes, \emph{e.g. \texttt{linksplitaxis} and \texttt{linkbaraxis}}.
474 While those linked axes might be used by graphs to plot the same axis
475 at both sides of the graph (when appropriate), every axis has a
476 \verb|createlinkaxis| method, which returns a standard linked axis.
478 \subsection{Special purpose axes}
480 \subsubsection{Splitable axes}
482 Axes with breaks are created by instances of the class
483 \verb|splitaxis|. Its constructor takes the following parameters:
485 \medskip
486 \begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X}
487 argument name&description\\
488 \hline
489 (axis list)&a list of axes to be used as subaxes (this is the first parameter of the constructor; it has no name)\\
490 \texttt{splitlist}&a single number or a list split points of the possitions of the axis breaks in graph coordinates; the value \texttt{None} forces \texttt{relsizesplitdist} to be used; default: \texttt{0.5}\\
491 \texttt{splitdist}&gap of the axis break; default: \texttt{0.1}\\
492 \texttt{relsizesplitdist}&used when \texttt{splitlist} entries are \texttt{None}; gap of the axis break in values of the surrounding axes (on logarithmic axes, a decade corresponds to 1); the split position is adjusted to give both surrounding axes the same scale (thus, their range must be completely fixed); default: \texttt{1}\\
493 \texttt{title}&axis title\\
494 \texttt{painter}&axis painter; default: \texttt{splitaxispainter()} (described below)\\
495 \end{tabularx}
496 \medskip
498 A split axis is build up from a list of ``subaxes''. Those subaxes
499 have to provide some range information needed to identify the subaxis
500 to be used out of a plain number (thus all axes minima and maxima has
501 to be set except for the two subaxes at the egde, where for the first
502 only the maximum is needed, while for the last only the minimum is
503 needed). The only point left is the description of the specialized
504 \verb|splitaxispainter|, where the constructor takes the following
505 parameters:
507 \medskip
508 \begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X}
509 argument name&description\\
510 \hline
511 \texttt{breaklinesdist}&(visual) distance between the break lines; default: \texttt{0.05}\\
512 \texttt{breaklineslength}&(visual) length of break lines; default: \texttt{0.5}\\
513 \texttt{breaklinesangle}&angle of the breakline with respect to the axis; default: \texttt{-60}\\
514 \texttt{breaklinesattrs}&stroke attributes for the break lines (\texttt{None} to turn off the break lines, otherwise a single value or a tuple); default: \texttt{()}\\
515 \end{tabularx}
517 Additionally, the painter takes parameters for the axis title
518 formatting like the standard axis painter class \verb|axispainter|.
519 (There is a common base class \verb|titleaxispainter| for that.) The
520 parameters are \verb|titledist|, \verb|titleattrs|,
521 \verb|titledirection|, and \verb|titlepos|.
523 \subsubsection{Bar axes}
525 Axes appropriate for bar graphs are created by instances of the class
526 \verb|baraxis|. Its constructor takes the following parameters:
528 \medskip
529 \begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X}
530 argument name&description\\
531 \hline
532 \texttt{subaxis}&baraxis can be recursive by having another axis as its subaxis; default: \texttt{None}\\
533 \texttt{multisubaxis}&contains another baraxis instance to be used to construct a new subaxes for each item (by that a nested bar axis with a different number of subbars at each bar can be created) ; default: \texttt{None}\\
534 \texttt{title}&axis title\\
535 \texttt{dist}&distance between bars (relative to the bar width); default: \texttt{0.5}\\
536 \texttt{firstdist}&distance of the first bar to the border; default: \texttt{0.5*dist}\\
537 \texttt{lastdist}&as before but for the last bar\\
538 \texttt{names}&tuple of name identifiers for bars; when set, no other identifiers are allowed; default: \texttt{None}\\
539 \texttt{texts}&dictionary translating names into label texts (otherwise just the names are used); default: \texttt{\{\}}\\
540 \texttt{painter}&axis painter; default: \texttt{baraxispainter} (described below)\\
541 \end{tabularx}
542 \medskip
544 In contrast to other axes, a bar axis uses name identifiers to
545 calculate a position at the axis. Usually, a style appropriate to a
546 bar axis (this is right now just the bar style) set those names out of
547 the data it recieves. However, the names can be forced and fixed.
549 Bar axes can be recursive. Thus for a given value, an appropriate
550 subaxis is choosen (usually another bar axis). Usually only a single
551 subaxis is needed, because it doesn't need to be painted and for each
552 value the same recursive subaxis transformation has to be applied.
553 This is achieved by using the parameter \verb|subaxis|. Alternatively
554 you may use the \verb|multisubaxis|. Here only a bar axis can be used.
555 Then the subaxes (note axes instead of axis) are painted as well
556 (however their painter can be set to not paint anything). For that,
557 duplications of the subaxis are created for each name. By that, each
558 subaxis can have different names, in particular different number of
559 names.
561 The only point left is the description of the specialized
562 \verb|baraxispainter|. It works quite similar to the
563 \verb|axispainter|. Thus the constructors have quite some parameters
564 in common, namely \verb|titledist|, \verb|titleattrs|,
565 \verb|titledirection|, \verb|titlepos|, and \verb|basepathattrs|.
566 Furthermore the parameters \verb|innerticklength| and
567 \verb|outerticklength| work like their counterparts in the
568 \verb|axispainter|, but only plain values are allowed there (no
569 lists). However, they are both \verb|None| by default and no ticks
570 get plotted. Then there is a hole bunch of name
571 attribute identifiers, namely \verb|namedist|, \verb|nameattrs|,
572 \verb|namedirection|, \verb|namehequalize|, \verb|namevequalize| which
573 are identical to their counterparts called \verb|label...| instead of
574 \verb|name...|. Last but not least, there is a parameter \verb|namepos|
575 which is analogous to \verb|titlepos| and set to \verb|0.5| by
576 default.
578 \section{Data}
579 \label{graph:data}
581 \subsection{List of points}
583 Instances of the class \verb|data| link together a \verb|datafile| (or
584 another instance of a class from the module \verb|data|) and a
585 \verb|style| (see below; default is \verb|symbol|). The link object is
586 needed in order to be able to plot several data from a singe file
587 without reading the file several times. However, for easy usage, it is
588 possible to provide just a filename instead of a \verb|datafile|
589 instance as the first argument to the constructor of the class
590 \verb|data| thus hiding the underlying \verb|datafile| instance
591 completely from view. This is the preferable solution as long as the
592 datafile gets used only once.
594 The additional parameters of the constructor of the class \verb|data|
595 are named parameters. The values of those parameters describe data
596 columns which are linked to the names of the parameters within the
597 style. The data columns can be identified directly via their number or
598 title, or by means of mathematical expression (as in the addcolumn
599 method of the class \verb|data| in the module \verb|data|; see
600 chapter~\ref{module:data}; indeed a addcolumn call takes place to
601 evaluate mathematical expressions once and for all).
603 The constructors keyword argument \verb|title| however does not
604 refer to a parameter of a style, but instead sets the title to be used
605 in the graph key. It might be set to \verb|None| to exclude the data
606 and style from the the graph key.
608 \subsection{Functions}
610 The class \verb|function| provides data generation out of a functional
611 expression. The default style for function plotting is \verb|line|.
612 The constructor of \verb|function| takes an expression as the first
613 parameter. The expression must be a string with exactly one equal sign
614 (\verb|=|). At the left side the result axis identifier must be placed
615 and at the right side the expression must depend on exactly one
616 variable axis identifier. Hence, a valid expression looks like
617 \verb|"y=sin(x)"|. You can access own variables and functions by
618 providing them as a dictionary to the constructors \verb|context|
619 keyword argument.
621 Additional named parameters of the constructor are:
623 \medskip
624 \begin{tabularx}{\linewidth}{ll>{\raggedright\arraybackslash}X}
625 argument name&default&description\\
626 \hline
627 \texttt{min}&\texttt{None}&minimal value for the variable parameter; when \texttt{None}, the axis data range will be used\\
628 \texttt{max}&\texttt{None}&as above, but for the maximum\\
629 \texttt{points}&\texttt{100}&number of points to be calculated\\
630 \texttt{parser}&\texttt{mathtree.parser()}&parser for the mathematical expression\\
631 \texttt{context}&\texttt{None}&dictionary of extern variables and functions\\
632 \texttt{title}&equal to the expression&title to be used in the graph key\\
633 \end{tabularx}
634 \medskip
636 The expression evaluation takes place at a linear raster on the
637 variable axis. More advanced methods (detection of rapidely changing
638 functions, handling of divergencies) are likely to be added in future
639 releases.
641 \subsection{Parametric functions}
643 The class \verb|paramfunction| provides data generation out of a
644 parametric representation of a function. The default style for
645 parametric function plotting is \verb|line|. The parameter list of the
646 constructor of \verb|paramfunction| starts with three parameters
647 describing the function parameter. The first parameter is a string,
648 namely the variable name. It is followed by a minimal and maximal
649 value to be used for that parameter. The next parameter contains an
650 expression assigning functions to the axis identifiers in a quite
651 pythonic tuple notation. As an example, such an expression could look
652 like \verb|"x, y = sin(k), cos(3*k)"|.
654 Additionally, the named parameters \verb|points|, \verb|parser|,
655 \verb|context|, and \verb|title| behave like their equally named
656 counterparts in \verb|function|.
658 \section{Styles}
659 \label{graph:styles}
661 Styles are used to draw data at a graph. A style determines what is
662 painted and how it is painted. Due to this powerfull approach there
663 are already some different styles available and the possibility to
664 introduce other styles opens even more prospects.
666 \subsection{Symbols}
668 The class \verb|symbol| can be used to plot symbols, errorbars and lines
669 configurable by parameters of the constructor. Providing \verb|None|
670 to attributes hides the according component.
672 \medskip
673 \begin{tabularx}{\linewidth}{ll>{\raggedright\arraybackslash}X}
674 argument name&default&description\\
675 \hline
676 \texttt{symbol}&\texttt{changesymbol.cross()}&symbol to be used (see below)\\
677 \texttt{size}&\texttt{"0.2 cm"}&size of the symbol (visual length)\\
678 \texttt{symbolattrs}&\texttt{deco.stroked}&draw attributes for the symbol\\
679 \texttt{errorscale}&\texttt{0.5}&size of the errorbar caps (relative to the symbol size)\\
680 \texttt{errorbarattrs}&\texttt{()}&stroke attributes for the errorbars\\
681 \texttt{lineattrs}&\texttt{None}&stroke attributes for the line\\
682 \end{tabularx}
683 \medskip
685 The parameter \verb|symbol| has to be a routine, which returns a path to
686 be drawn (e.g. stroked or filled). There are several such routines
687 already available in the class \verb|symbol|, namely \verb|cross|,
688 \verb|plus|, \verb|square|, \verb|triangle|, \verb|circle|, and
689 \verb|diamond|. Furthermore, changeable attributes might be used here
690 (like the default value \verb|changesymbol.cross|), see
691 section~\ref{graph:changeattrs} for details.
693 The attributes are available as class variables after plotting the
694 style for outside usage. Additionally, the variable \verb|path|
695 contains the path of the line (even when it wasn't plotted), which
696 might be used to get crossing points, fill areas, etc.
698 Valid data names to be used when providing data to symbols are listed
699 in the following table. The character \verb|X| stands for axis names
700 like \verb|x|, \verb|x2|, \verb|y|, etc.
702 \begin{center}
703 \begin{tabular}{ll}
704 data name&description\\
705 \hline
706 \texttt{X}&position of the symbol\\
707 \texttt{Xmin}&minimum for the errorbar\\
708 \texttt{Xmax}&maximum for the errorbar\\
709 \texttt{dX}&relative size of the errorbar: \texttt{Xmin, Xmax = X-dX, X+Xd}\\
710 \texttt{dXmin}&relative minimum \texttt{Xmin = X-dXmin}\\
711 \texttt{dXmax}&relative maximum \texttt{Xmax = X+dXmax}\\
712 \end{tabular}
713 \end{center}
715 \subsection{Lines}
717 The class \verb|line| is inherited from the class \verb|symbol| and
718 restricted itself to line drawing. The constructor takes only the
719 \verb|lineattrs| keyword argment, which is by default set to
720 \verb|(changelinestyle(), style.linejoin.round)|. The other features
721 of the symbol style are turned off.
723 \subsection{Rectangles}
725 The class \verb|rect| draws filled rectangles into a graph. The size
726 and the position of the rectangles to be plotted can be provided by
727 the same data names like for the errorbars of the class \verb|symbol|.
728 Indeed, the class \verb|symbol| reuses most of the symbol code by
729 inheritance, while modifying the errorbar look into a colored filled
730 rectangle and turing off the symbol itself.
732 The color to be used for the filling of the rectangles is taken from a
733 palette provided to the constructor by the named parameter
734 \verb|palette| (default is \verb|color.palette.Gray|). The data
735 name \verb|color| is used to select the color out of this palette.
737 \subsection{Texts}
739 Another style to be used within graphs is the class \verb|text|, which
740 adds the output of text to the class \verb|symbol|. The text
741 position relative to the symbol is defined by the two named
742 parameters \verb|textdx| and \verb|textdy| having a default of
743 \verb|"0 cm"| and \verb|"0.3 cm"|, respectively, which are by default
744 interpreted as visual length. A further named parameter
745 \verb|textattrs| may contain a list of text attributes (or just a
746 single attribute). The default for this parameter is
747 \verb|text.halign.center|. Furthermore the constructor of this class
748 allows all other attributes of the class \verb|symbol|.
750 \subsection{Arrows}
752 The class \verb|arrow| can be used to plot small arrows into a graph
753 where the size and direction of the arrows has to be given within the
754 data. The constructor of the class takes the following parameters:
756 \medskip
757 \begin{tabularx}{\linewidth}{ll>{\raggedright\arraybackslash}X}
758 argument name&default&description\\
759 \hline
760 \texttt{linelength}&\texttt{"0.2 cm"}&length of a the arrow line (visual length)\\
761 \texttt{arrowattrs}&\texttt{()}&stroke attributes\\
762 \texttt{arrowsize}&\texttt{"0.1 cm"}&size of the arrow (visual length)\\
763 \texttt{arrowdict}&\texttt{\{\}}&attributes to be used in the \texttt{earrow} constructor\\
764 \texttt{epsilon}&1e-10&smallest allowed arrow size factor for a arrow to become plotted (avoid numerical instabilities)\\
765 \end{tabularx}
766 \medskip
768 The arrow allows for data names like the symbol and introduces
769 additionally the data names \verb|size| for the arrow size (as an
770 multiplicator for the sizes provided to the constructor) and
771 \verb|angle| for the arrow direction (in degree).
773 \subsection{Bars}
775 The class \verb|bar| must be used in combination with an
776 \verb|baraxis| in order to create bar plots. The constructor takes the
777 following parameters:
779 \medskip
780 \begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X}
781 argument name&description\\
782 \hline
783 \texttt{fromzero}&bars start at zero (boolean); default: \texttt{1}\\
784 \texttt{stacked}&stack bars (boolean/integer); for values bigger than 1 it is the number of bars to be stacked; default: \texttt{0}\\
785 \texttt{skipmissing}&skip entries in the bar axis, when datapoints are missing; default: \texttt{1}\\
786 \texttt{xbar}&bars parallel to the graphs x-direction (boolean); default: \texttt{0}\\
787 \texttt{barattrs}&fill attributes; default: \texttt{(deco.stroked(color.gray.black), changecolor.Rainbow())}\\
788 \end{tabularx}
790 Additionally, the bar style takes two data names appropriate to the
791 graph (like \verb|x|, \verb|x2|, and \verb|y|).
793 \subsection{Iterateable style attributes}
794 \label{graph:changeattrs}
796 The attributes provided to the constructors of styles can usually
797 handle so called iterateable attributes, which are changing itself
798 when plotting several data sets. Iterateable attributes can be easily
799 written, but there are already some iterateable attributes available
800 for the most common cases. For example a color change is done by
801 instances of the class \verb|colorchange|, where the constructor takes
802 a palette. Applying this attribute to a style and using this style at
803 a list of data, the color will get changed lineary along the
804 palette from one end to the other. The class \verb|colorchange|
805 includes inherited classes as class variables, which are called like
806 the color palettes shown in appendix~\ref{palettename}. For them the
807 default palette is set to the appropriate color palette.
809 Another attribute changer is called \verb|changesequence|. The
810 constructor takes a list of attributes and the attribute changer
811 cycles through this list whenever a new attribute is requested.
812 This attribute changer is used to implement the following attribute
813 changers:
815 \begin{center}
816 \begin{tabular}{ll}
817 attribute changer&description\\
818 \hline
819 \texttt{changelinestyle}&iterates linestyles solid, dashed, dotted, dashdotted\\
820 \texttt{changestrokedfilled}&iterates \texttt{(deco.stroked, deco.filled)}\\
821 \texttt{changefilledstroked}&iterates \texttt{(deco.filled, deco.stroked)}\\
822 \end{tabular}
823 \end{center}
825 The class \verb|changesymbol| can be used to cycle throu symbols and it
826 provides already various specialized classes as class variables. To
827 loop over all available symbols (cross, plus, square, triangle,
828 circle, and diamond) the equal named class variables can be used. They
829 start at that symbol they are named of. Thus \verb|changesymbol.cross()|
830 cycles throu the list starting at the cross symbol. Furthermore
831 there are four class variables called \verb|squaretwice|,
832 \verb|triangletwice|, \verb|circletwice|, and \verb|diamondtwice|.
833 They cycle throu the four fillable symbols, but returning the symbols
834 twice before they go on to the next one. They are intented to be used
835 in combination with \verb|changestrokedfilled| and
836 \verb|changefilledstroked|.
838 \section{Keys}
840 Graph keys can be created by instances of the class \verb|key|. Its
841 constructor takes the following keyword arguments:
843 \medskip
844 \begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X}
845 argument name&description\\
846 \hline
847 \texttt{dist}&(vertical) distance between the key entries (visual length); default: \texttt{"0.2 cm"}\\
848 \texttt{pos}&\texttt{"tr"} (top right; default), \texttt{"br"} (bottom right), \texttt{"tl"} (top left), \texttt{"bl"} (bottom left)\\
849 \texttt{hdist}&horizontal distance of the key (visual length); default: \texttt{"0.6 cm"}\\
850 \texttt{vdist}&vertical distance of the key (visual length); default: \texttt{"0.4 cm"}\\
851 \texttt{hinside}&align horizonally inside to the graph (boolean); default: \texttt{1}\\
852 \texttt{vinside}&align vertically inside to the graph (boolean); default: \texttt{1}\\
853 \texttt{symbolwidth}&width reserved for the symbol (visual length); default: \texttt{"0.5 cm"}\\
854 \texttt{symbolheight}&height reserved for the symbol (visual length); default: \texttt{"0.25 cm"}\\
855 \texttt{symbolspace}&distance between symbol and text (visual length); default: \texttt{"0.2 cm"}\\
856 \texttt{textattrs}&text attributes (a list or a single entry); default: \texttt{text.vshift.mathaxis}\\
857 \end{tabularx}
858 \medskip
860 The data description to be printed in the graph key is given by the
861 title of the data drawn.
863 \section{X-Y-Graph}
865 The class \verb|graphxy| draws standard x-y-graphs. It is a subcanvas
866 and can thus be just inserted into a canvas. The x-axes are named
867 \verb|x|, \verb|x2|, \verb|x3|, \dots and equally the y-axes. The
868 number of axes is not limited. All odd numbered axes are plotted at
869 the bottom (for x axes) and at the left (for y axes) and all even
870 numbered axes are plotted opposite to them. The lower numbers are
871 closer to the graph.
873 The constructor of \verb|graphxy| takes axes as named parameters where
874 the parameter name is an axis name as just described. Those parameters
875 refer to an axis instance as they where described in
876 section~\ref{graph:axes}. When no \verb|x| or \verb|y| is provided,
877 they are automatically set to instances of \verb|linaxis|. When no
878 \verb|x2| or \verb|y2| axes are given they are initialized as standard
879 linkaxis to the axis \verb|x| and \verb|y|. However, you can turn off
880 the automatism by setting those axes explicitly to \verb|None|.
882 However, the constructor takes some more attributes listed in the
883 following table:
885 \medskip
886 \begin{tabularx}{\linewidth}{ll>{\raggedright\arraybackslash}X}
887 argument name&default&description\\
888 \hline
889 \texttt{xpos}&\texttt{"0"}&x position of the graph (user length)\\
890 \texttt{ypos}&\texttt{"0"}&y position of the graph (user length)\\
891 \texttt{width}&\texttt{None}&width of the graph area (axes are outside of that range)\\
892 \texttt{height}&\texttt{None}&as abovem, but for the height\\
893 \texttt{ratio}&\texttt{goldenrule}&width/height ratio when only a width or height is provided\\
894 \texttt{backgroundattrs}&\texttt{None}&background attributes for the graph area\\
895 \texttt{axisdist}&\texttt{"0.8 cm"}&distance between axis (visual length)\\
896 \texttt{key}&\texttt{None}&\texttt{key} instance for an automatic graph key\\
897 \end{tabularx}
898 \medskip
900 After a graph is constructed, data can be plotted via the \verb|plot|
901 method. The first argument should be an instance of the data providing
902 classes described in section~\ref{graph:data}. This first parameter
903 can also be a list of those instances when you want to iterate the
904 style you explicitly provide as a second parameter to the plot method.
905 The plot method returns the plotinfo instance (or a list of plotinfo
906 instances when a data list was provided). The plotinfo class has
907 attributes \verb|data| and \verb|style|, which provide access to the
908 plotted data and the style, respectively. Just as an example, from the
909 style you can access the path of the drawed line, fill areas with it
910 etc.
912 After the plot method was called once or several times, you may
913 explicitly call the method \verb|finish|. Most of the graphs
914 functionallity becomes available just after (partially) finishing the
915 graph. A partial finish can even modify the order in which a graph
916 performs its drawing process. By default the five methods
917 \verb|dolayout|, \verb|dobackground|, \verb|doaxis|, \verb|dodata|,
918 and \verb|dokey| are called in that order. The method \verb|dolayout|
919 must always be called first, but this is internally ensured once you
920 call any of the routines yourself. After \verb|dolayout| gets called,
921 the method \verb|plot| can not be used anymore.
923 To get a position within a graph as a tuple out of some axes values,
924 the method \verb|pos| can be used. It takes two values for a position
925 at the x and y axis. By default, the axes named \verb|x| or \verb|y|
926 are used, but this is changed when the keyword arguments \verb|xaxis|
927 and \verb|yaxis| are set to other axes. The graph axes are available
928 by their name using the dictionary \verb|axes|. There is also an
929 dictionary \verb|axespos|, which contains \verb|lineaxespos| instances
930 for all axes. They implement the \verb|_Iaxispos| interface, thus
931 having the following methods:
933 \medskip
934 \begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X}
935 method name&description\\
936 \hline
937 \texttt{basepath(x1=None, x2=None)}&returns the base path for the range \texttt{x1} to \texttt{x2}, (hole range, when omitting the parameters)\\
938 \texttt{vbasepath(x1=None, x2=None)}&as above but for graph coordinates\\
939 \texttt{gridpath(x)}&returns the grid path\\
940 \texttt{vgridpath(x)}&as above but for graph coordinates\\
941 \texttt{tickpoint(x)}&returns the position of a tick\\
942 \texttt{vtickpoint(x)}&as above but for graph coordinates\\
943 \texttt{tickdirection(x)}&returns the direction, a tick should be drawn (towards inside of the graph)\\
944 \texttt{vtickdirection(x)}&as above but for graph coordinates\\
945 \end{tabularx}
946 \medskip
948 Its likely, that this interface will change to contain local
949 transformation for the tick position/direction in a future release.
950 For the axes named \verb|x| and \verb|y|, the methods are available
951 within the graph (like the \verb|pos| method), where the method name
952 is prefixed by \verb|x| or \verb|y|, respectively.
954 To manually add a graph key, use the \verb|addkey| method, which takes
955 a \verb|key| instance first followed by several \verb|plotinfo|
956 instances.