Skip to content

[Broken Documentation] API change for figurefirst:mplmethods? #57

@alchem0x2A

Description

@alchem0x2A

Hi

Thanks a lot for the wonderful package! I really enjoyed the workflow of FigureFirst and is gradually checking the examples.


I think the documentation for the axis methods is somehow broken (https://figurefirst.readthedocs.io/en/latest/examples.html#axis-methods), as the code in the example has no effect to draw an hspan.

From what I understand, in version 0.0.6 you need to add a node figurefirst:mplmethods inside the figurefirst:axis node. Is that correct?


Also there're some side thoughts, I propose to add another functionality FigureLayout.set_axis_props which parse the attributes within figurefirst:axis except reserved names like figurefirst:name, as a property of mpl.axes.Axes, and set the value using the setter.

For instance:

In the current version the hierarchy is:

figurefirst:axis node
   figurefirst: mplmethods node
        figurefirst:set_yticks="[]"

While in the proposed implementation
In the current version the hierarchy is:

figurefirst:axis node
    figurefirst:yticks="[]"

I may have several reasons for this:

  1. The readability is better than the mplmethods
  2. Explicitly writing the set_ prefix can be omitted, as from my personal usage, most likely the mplmethod of an axis instance is to call a setter of the Axes class, e.g. ax.set_yticks=[] for a subplot.
  3. In this case mplmethod can be some functions that solely does simple plotting / patching jobs.

I appreciate much your feedback / suggestions.Happy to contribute PRs if you find it reasonable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions