You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Applications are open for the 2018 John Hunter Matplotlib Summer Fellowship. Apply now!
Version 2.2.2.post1695+gedd053d16
matplotlib
Fork me on GitHub

Related Topics

Radian ticksΒΆ

Plot with radians from the basic_units mockup example package.

This example shows how the unit class can determine the tick locating, formatting and axis labeling.

This example requires basic_units.py

../../_images/sphx_glr_radian_demo_001.png
import matplotlib.pyplot as plt
import numpy as np

from basic_units import radians, degrees, cos

x = [val*radians for val in np.arange(0, 15, 0.01)]

fig, axs = plt.subplots(2)

axs[0].plot(x, cos(x), xunits=radians)
axs[1].plot(x, cos(x), xunits=degrees)

fig.tight_layout()
plt.show()

Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery