Skip to content

utils.draw.fix_log_axis

Function ยท Source

mdnc.utils.draw.fix_log_axis(
    ax=None, axis='y'
)

Control the log axis to be limited in 10n ticks.

This function is not recommended, because it would take effects globally. Please use mdnc.utils.draw.setFigure as a safer way.

Arguments

Requries

Argument Type Description
ax object The subplot that requires to be controlled. If set None, the plt.gca() would be used.
axis str Make which axis to be normalized, could be: 'x', 'y' or 'xy'.

Examples

Example
1
2
3
4
5
6
7
8
9
import numpy as np
import matplotlib.pyplot as plt
import mdnc

t = np.linspace(0, 1, 100)
plt.plot(t, 0.01 + 0.04 * t)
plt.yscale('log')
mdnc.utils.draw.fix_log_axis(axis='y')
plt.show()


Last update: March 14, 2021

Comments