I have this simple code to plot some values:
ticks = [0, 1e-12, 1e-10, 1e-8, 1e-6, 1e-4]
values = range(1, 7)
plt.plot(ticks, values)
plt.xscale('log')
plt.show()
The problem is that the point (0, 1) does not get plotted. I tried fixing this by adding one line of code:
ticks = [0, 1e-12, 1e-10, 1e-8, 1e-6, 1e-4]
values = range(1, 7)
plt.plot(ticks, values)
plt.xscale('log')
plt.xticks(ticks) <------- added this line --------
plt.show()
But the result is:
Which is definitely not what I want. My goal is to correctly plot the point (0, 1) and also set custom ticks in the x-axis, namely the values in ticks
(0, 1e-12, 1e-10, 1e-8, 1e-6, 1e-4)
How am I supposed to do that? I've looked around and found no answer