#6 linkedaxis defaults if axes is changed.

Jorge Leitão

Problem: On a graph, the opposite line of an axes don't change when basepathattrs are changed on a graph.axis.painter. This is unlikely what most users would like, as for instance it causes different sides of the graph to have different line attributes (if a user increases line width of the axes, he/she expects the same to be done, by default, on the other side of the graph).

the attributes of axies.painter are not passed to axis.linkpainter in creation of axis. In particular, the class _regularaxis initializes as

def init(self, min=None, max=None, reverse=0, divisor=None, title=None,
painter=painter.regular(), texter=texter.mixed(), linkpainter=painter.linked(),
density=1, maxworse=2, manualticks=[], fallbackrange=None):

causing the painter's attributes not to be passed to the linkpainter, but rather a simple creation of a painter.linked().

Proposal: make some of the attributes of _regularaxis.painter to be passed to _regularaxis.linkpainter during initialization of _regularaxis. This behavior is also found on other programs, e.g. xmgrace.

Discussion: Because not all of the attributes would likely (by most users) be passed to the linked painter (e.g. outerticklength is not so useful if the axes has no labels by default), I propose the following minimal set of attributes to be passed:


  • Andre Wobst
    Andre Wobst

    • status: open --> closed
  • Andre Wobst
    Andre Wobst

    Unfortunately it is not that easy. The linked painter is responsible for not displaying the labels another time and thus does have other settings like the regular painter. If you alter the corresponding attribute for the axis, you probably do not want the have the labels showing up on the linked axis, too.

    I'm thinking about a larger redesign of all the parameters of the axes, though. Currently it is rather verbose to change a painter setting, as you need to pass a new painter instance. And since I want to split the painter into several painters responsible for some single feature only (like the axis title, the labels, the ticks, separately), it becomes even more clumsy.

    In general I like you idea, and it should be considered in the upcoming design. But this is a long term issue.

    I'm closing the issue here, as it cannot be implemented in the current design without breaking the inherent rules we have. But please do not read this as a "wont-fix", it is to be addressed on a different level.