Which call makes the y-axis of the current plot logarithmic?
-
A
plt.ylabel('log')
-
B
plt.ylog(True)
-
C
plt.yscale('log')
Correct answer
-
D
plt.yaxis('log')
Correct answer
C. plt.yscale('log')
16 views
Explanation
plt.yscale('log'), or ax.set_yscale('log'), is useful for data spanning several orders of magnitude, such as population or COVID case counts.
Reference
Asked in: Data Science Interviews
Doubts & discussion
Not sure why the answer is C? Ask here and get an explanation.
Ask a doubt about this MCQ