Skip to content

New function for xylim #16424

@kolibril13

Description

@kolibril13

I would really like to use an intuitve function, where one does not have to define xlim and ylim separately.
A nice name could be xylim.

def xylim(xinterval,yinterval):
    plt.xlim(xinterval[0],xinterval[1])
    plt.ylim(yinterval[0],yinterval[1])

plt.xylim( [10,20]  ,  [9,90] )

This would make it possible to writer denser code, without loosing readability.
Further it would be quit intuitive to use.
It took a while for me to find plt.axis which does set both x and y limits in one line of code, however it is used with [xmin xmax ymin ymax] (eg. plt.axis([0, 6,0, 20])), which is in my opinion less readable then e.g. plt.xylim( [0,6] , [0,20] )
What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions