I'm trying to reproduce this graph -- specifically the log-scale x-axis:
The main objective is for me to be able to display the x-axis as equally spaced log-scale.
I am currently using semilogx from matplotlib, however this does not include 0 (of course, log(0) would be undefined). However, I have a data point at 0, and need to display it. As it is, my code looks like this:
dt = 0.01
t = np.arange(0, 1, 0.1)
x = [0, 10**-6, 10**-5, 10**-4, 10**-3, 10**-2, 1]
dfy = list(averages.iloc[0, :]) # where averages is a row with 7 entries
plt.plot(x, dfy, marker = 'o', linestyle = '') # plots graph
plt.semilogx(t, np.exp(-t/5.0), linestyle = '')
The graph produced looks like this, which I am happy with except for the missing 0:
I have tried:
plt.xscale('symlog')
plt.xscale('log')
However, this does not produce the evenly spaced log scale that is needed. In addtion, I have tried instead of using 0, 10^-16 however this just includes all of the powers between -6 and -16. I need it to go from 0 and then immediately to 10^-6.
Any advice is appreciated. Thanks in advance.