MemoryError with numpy arange
In this case the function logspace from numpy is more suitable.
The answer to the example is
np.logspace(3,15,num=15-3+1, endpoint=True)
I want to create an array of powers of 10 as a label for the y axis of a plot.
I am using the plt.yticks() with matplotlib imported as plt but this does not matter here anyway.
I have plots where as the y axis is varying from 1e3 to 1e15. Those are log plots.
Matplotlib is automatically displaying those with ticks with 1e2 steps and I want to have a step of 10 instead (in order to be able to use the minorticks properly).
I want to use the plt.yticks(numpy.arange(1e3, 1e15, 10)) command as said but numpy.arange(1e3, 1e15, 10) result in a MemoryError. Isn't it supposed to output an array of length 13? Why does the memory gets full?
How to overpass this issue and not build the array manually?
I also tried using built-in range but it won't work with floats.
Thank you.