Skip to content

Idea: unite xlim and set_xlim to same function #15938

Closed as not planned
Closed as not planned
@kolibril13

Description

@kolibril13

I think it is confusing that the limits are normally set by xlim and in subplots by set_xlim.
Would it not be nice to use the same name ax.xlim(0,1) for subplots ?

import numpy as np
import matplotlib.pyplot as plt
plt.figure(1)
plt.xlim(0, 1)
plt.plot([1, 2])

fix, ax = plt.subplots()
ax.set_xlim(0, 1) ##  why not ax.xlim(0,1) ?
ax.plot([1, 2])

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions