Skip to content

create new function autosize_y_axis #3

Description

@queirozfcom

I always need to do this, in every plot

plt.ylim(0,100)
plt.yticks(np.arange(0,101,10))

where:

  • 100 is the top value in the y axis
  • 101 is the top value plus 1 (or the top value doesn't show up in the axis)
  • 10 is the space between ticks in the axis
    • this should be calculated so that there are 10 ticks. 10 is a sensible default, but allow users to adjust that obviously)
    • the ticks must be whole numbers like 1,000 and 10,000 and go up in whole numbers too.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions