[ Web Proxy ]
URL:
Viewing: https://matplotlib.org/stable/api/_as_gen/../../gallery/misc/../mplot3d/../units/radian_demo.html [Back]  [Original]

Radian ticks — Matplotlib 3.11.2 documentation
Back to top
Search the docs ...:

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

radian demo [radian demo]
from basic_units import cos, degrees, radians

import matplotlib.pyplot as plt
import numpy as np

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()

Total running time of the script: (0 minutes 1.282 seconds)

Gallery generated by Sphinx-Gallery


Web Proxy Viewer  |  New URL  |  Original Page