As this answer https://stackoverflow.com/a/47850534 points out, np.log(x)
is not the same as plotting x
on a log scale.
Given (the same) array of data:
x = [2, 1, 76, 140, 286, 267, 60, 271, 5, 13, 9, 76, 77, 6, 2, 27, 22, 1, 12, 7, 19, 81, 11, 173, 13, 7, 16, 19, 23, 197, 167, 1]
Plotting the data directly has a chart like so:
plt.plot(x)
plt.show()
Using the 'log' scale looks like:
plt.plot(x)
plt.xscale('log')
plt.show()
Plotting np.log(x)
does something entirely different:
plt.plot(np.log(x))
plt.show()
Is there a function that rescales the array values in logspace, or would this require something like interpolation?