Python, Matplotlib, subplot: How to set the axis range?

638    Asked by Amitjaisawal in Python , Asked on Mar 2, 2021
Answered by Amit jaisawal

It very well may be finished by axes objects is an extraordinary methodology for this. It encourages in the event that you need to collaborate with numerous figures and sub-plots. To add and control the axes protests straightforwardly:


import matplotlib.pyplot as plt

fig = plt.figure(figsize=(12,9))

signal_axes = fig.add_subplot(211) signal_axes.plot(xs,rawsignal)

fft_axes = fig.add_subplot(212)

fft_axes.set_title("FFT")

fft_axes.set_autoscaley_on(False)

fft_axes.set_ylim([0,1000])

fft = scipy.fft(rawsignal)

fft_axes.plot(abs(fft))

plt.show()



Your Answer

Interviews

Parent Categories