saving . . . saved Embellishing a plot has been deleted. Embellishing a plot has been hidden .
Embellishing a plot
Title
Question
Maximum and minimum limit of set and get axes?

Python Embellishing-a-plot 14-15 min 10-20 sec 22-06-19, 11:38 a.m. rsumathi

Answers:

get or set the x limits of the current axes.

xmin, xmax = xlim()   # return the current xlim
xlim( (xmin, xmax) )  # set the xlim to xmin, xmax
xlim( xmin, xmax )    # set the xlim to xmin, xmax<paste>

change x-axis limits

import matplotlib.pyplot as plt
w = 4
h = 3
d = 70
plt.figure(figsize=(w, h), dpi=d)
x = [1, 2, 4, 3, 0]
plt.xlim(0, 10)
plt.plot(x)
plt.savefig("out.png")
18-04-20, 12:20 a.m. iakashchavan


Log-in to answer to this question.