Answers for "matplotlib log scale y-axis"

3

matplotlib y axis log scale

import pylab
import matplotlib.pyplot as plt
a = [pow(10, i) for i in range(10)]
fig = plt.figure()
ax = fig.add_subplot(2, 1, 1)

line, = ax.plot(a, color='blue', lw=2)

ax.set_yscale('log')

pylab.show()
Posted by: Guest on August-23-2020
0

matplotlib log scale y axis base

ax.set_yscale("log", base=2).
Posted by: Guest on August-28-2021

Python Answers by Framework

Browse Popular Code Answers by Language