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

524    Asked by FukudaAshikaga in Python , Asked on Mar 3, 2021
Answered by Fukuda Ashikaga

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