Skip to content

Order, orientation -> transpose ? #72

Closed

Description

@stefraynaud

The orientation keyword is used to transpose 1d plots and make them vertical.

In the same way, the order keyword is used in 2D plots to change the way dims are interpreted.
https://github.com/lukelbd/proplot/blob/591dac72fd33124b793e6d1e37e297005196a633/proplot/wrappers.py#L410
I'm not sure this is crucial since you always have to check the consistency between coordinates and data. In addition, this latter keyword can be confused with the matplotlib keyword. Is this one no longer accessible?

Don't you think a global transpose keyword would be more appropriate, for both 1D and 2D plots? For 2D plots, a value like "auto" would even try to guess the appropriate orientation depending on coordinates variations along dimensions, and potentially, attributes (lon, lat, time, etc....).

Activity

  1. lukelbd commented on Nov 28, 2019

    @lukelbd
    Collaborator

    Makes sense to me. Note order derives from numpy, was just trying to go with their conventions. Want to submit a PR? I can also get to it sometime in December.

    Also since you seem to be digging into these wrapper functions, keep an eye on #45 -- wrappers will soon eventually be broken up into private helper functions and applied to dedicated ax.plot, ax.contour, etc. methods individually.

  2. added this to the Version 0.8 milestone on Jul 21, 2021
  3. lukelbd commented on Sep 8, 2021

    @lukelbd
    Collaborator

    I've finally added transpose as an alternative to order for the 2D plotting commands (b90cac4).

    I decided I'd rather not add transpose for the 1D plotting commands -- the new paradigm is to use "horizontal" versions of each plotting command (e.g. plot and plotx, boxplot and boxploth, etc.). This is succinct/clear enough. It was motivated by matplotlib's "horizontal" commands like barh and fill_betweenx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions