5.6 Module graph.axis.painter: Painter

The following classes are part of the module graph.axis.painter. Instances of the painter classes can be passed to the painter keyword argument of regular axes.

class rotatetext( direction, epsilon=1e-10)
This helper class is used in direction arguments of the painters below to prevent axis labels and titles being written upside down. In those cases the text will be rotated by 180 degrees. direction is an angle to be used relative to the tick direction. epsilon is the value by which 90 degrees can be exceeded before an 180 degree rotation is performed.

The following two class variables are initialized for the most common applications:

parallel
rotatetext(90)

orthogonal
rotatetext(180)

class ticklength( initial, factor)
This helper class provides changeable PyX lengths starting from an initial value initial multiplied by factor again and again. The resulting lengths are thus a geometric series.

There are some class variables initialized with suitable values for tick stroking. They are named ticklength.SHORT, ticklength.SHORt, ..., ticklength.short, ticklength.normal, ticklength.long, ..., ticklength.LONG. ticklength.normal is initialized with a length of 0.12 and the reciprocal of the golden mean as factor whereas the others have a modified initial value obtained by multiplication with or division by appropriate multiples of $\sqrt{2}$.

class regular( innerticklength=ticklength.normal, outerticklength=None, tickattrs=[], gridattrs=None, basepathattrs=[], labeldist="0.3 cm", labelattrs=[], labeldirection=None, labelhequalize=0, labelvequalize=1, titledist="0.3 cm", titleattrs=[], titledirection=rotatetext.parallel, titlepos=0.5, texrunner=None)
Instances of this class are painters for regular axes like linear and logarithmic axes.

innerticklength and outerticklength are visual PyX lengths of the ticks, subticks, subsubticks etc. plotted along the axis inside and outside of the graph. Provide changeable attributes to modify the lengths of ticks compared to subticks etc. None turns off the ticks inside and outside the graph, respectively.

tickattrs and gridattrs are changeable stroke attributes for the ticks and the grid, where None turns off the feature. basepathattrs are stroke attributes for the axis or None to turn it off. basepathattrs is merged with [style.linecap.square].

labeldist is the distance of the labels from the axis base path as a visual PyX length. labelattrs is a list of text attributes for the labels. It is merged with [text.halign.center, text.vshift.mathaxis]. labeldirection is an instance of rotatetext to rotate the labels relative to the axis tick direction or None.

The boolean values labelhequalize and labelvequalize force an equal alignment of all labels for straight vertical and horizontal axes, respectively.

titledist is the distance of the title from the rest of the axis as a visual PyX length. titleattrs is a list of text attributes for the title. It is merged with [text.halign.center, text.vshift.mathaxis]. titledirection is an instance of rotatetext to rotate the title relative to the axis tick direction or None. titlepos is the position of the title in graph coordinates.

texrunner is the texrunner instance to create axis text like the axis title or labels. When not set the texrunner of the graph instance is taken to create the text.

class linked( innerticklength=ticklength.short, outerticklength=None, tickattrs=[], gridattrs=None, basepathattrs=[], labeldist="0.3 cm", labelattrs=None, labeldirection=None, labelhequalize=0, labelvequalize=1, titledist="0.3 cm", titleattrs=None, titledirection=rotatetext.parallel, titlepos=0.5, texrunner=None)
This class is identical to regular up to the default values of labelattrs and titleattrs. By turning off those features, this painter is suitable for linked axes.

class bar( innerticklength=None, outerticklength=None, tickattrs=[], basepathattrs=[], namedist="0.3 cm", nameattrs=[], namedirection=None, namepos=0.5, namehequalize=0, namevequalize=1, titledist="0.3 cm", titleattrs=[], titledirection=rotatetext.parallel, titlepos=0.5, texrunner=None)
Instances of this class are suitable painters for bar axes.

innerticklength and outerticklength are visual PyX lengths to mark the different bar regions along the axis inside and outside of the graph. None turns off the ticks inside and outside the graph, respectively. tickattrs are stroke attributes for the ticks or None to turn all ticks off.

The parameters with prefix name are identical to their label counterparts in regular. All other parameters have the same meaning as in regular.

class linkedbar( innerticklength=None, outerticklength=None, tickattrs=[], basepathattrs=[], namedist="0.3 cm", nameattrs=None, namedirection=None, namepos=0.5, namehequalize=0, namevequalize=1, titledist="0.3 cm", titleattrs=None, titledirection=rotatetext.parallel, titlepos=0.5, texrunner=None)
This class is identical to bar up to the default values of nameattrs and titleattrs. By turning off those features, this painter is suitable for linked bar axes.

class split( breaklinesdist="0.05 cm", breaklineslength="0.5 cm", breaklinesangle=-60, titledist="0.3 cm", titleattrs=[], titledirection=rotatetext.parallel, titlepos=0.5, texrunner=None)
Instances of this class are suitable painters for split axes.

breaklinesdist and breaklineslength are the distance between axes break markers in visual PyX lengths. breaklinesangle is the angle of the axis break marker with respect to the base path of the axis. All other parameters have the same meaning as in regular.

class linkedsplit( breaklinesdist="0.05 cm", breaklineslength="0.5 cm", breaklinesangle=-60, titledist="0.3 cm", titleattrs=None, titledirection=rotatetext.parallel, titlepos=0.5, texrunner=None)
This class is identical to split up to the default value of titleattrs. By turning off this feature, this painter is suitable for linked split axes.