1 Upvote

Setting Axis Range on a Matplotlib Chart

Python
Visualisation & EDA

Here we set the axis range to 40-52 for the X axis, 0-4000 for the primary y axis and 0-1200 for the secondary y axis.

ax.set_xlim(40,52) #Set range of X axis
ax.set_ylim(0,4000) # Set range of primary y axis
ax2.set_ylim(0,1200) # Set range of secondary y axis

By analyseup - Last Updated Jan. 12, 2022, 12:32 a.m.

Did you find this snippet useful?

Sign up to bookmark this in your snippet library

COMMENTS
RELATED SNIPPETS
2
Top Contributors
103
100