Let's consider the following example to plot some y values for given x values.
import matplotlib.pyplot as pyplot
if __name__ == "__main__":
x = [1000000000, 2000000000, 4000000000, 8000000000]
y = [0.342, 0.543, 0.874, 1.324]
pyplot.bar(x, y)
pyplot.savefig("test1.png", format="png")
pyplot.close()
pyplot.bar([str(int(x_value / 1000000000)) for x_value in x], y)
pyplot.savefig("test2.png", format="png")
pyplot.close()
My goal is to have equally-spaced x-ticks for all x values (i.e., not linearly scaled). Moreover, I'd like to see the values in scientific notation (i.e., 1e9).
test1.png does not show anything meaningful at all.
test2.png shows the values in the desired way, but does not have the scientific label on the bottom right (1e9).
How can I either place 1e9 manually in the x-axis unit location or work around my issue?


