Is there a quick way to scale axis in matplotlib?
Say I want to plot
import matplotlib.pyplot as plt
c= [10,20 ,30 , 40]
plt.plot(c)
it will plot
How can I scale x-axis quickly, say multiplying every value with 5
?
One way is creating an array for x axis:
x = [i*5 for i in range(len(c))]
plt.plot(x,c)
I am wondering if there is a shorter way to do that, without creating a list for x axis, say something like plt.plot(index(c)*5, c)