1

The values of Y are like [0, 2, 38, 47, 123, 234, 1003, 100004, 50000003, 1000000004]

The figure I want to get is just as following:

logplot

1 Answer 1

4

From the examples here

# log y axis
import matplotlib.pyplot as plt
import numpy as np

t = np.arange(0.01, 20.0, 0.01)
plt.subplot(221)
plt.semilogy(t, np.exp(-t/5.0))
plt.title('semilogy')
plt.grid(True)
plt.show()

So use plt.semilogy(). If you want a X-axis with a log-scale, use plt.semilogx(). For both axis on a log-scale, use plt.loglog().

Sign up to request clarification or add additional context in comments.

1 Comment

Although the OP only explicitly asks about the y-values, the wanted figure clearly has a logged x-axis as well. Maybe the OP forgot this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.