[1]:
import sys
import rics
# Print relevant versions
print(f"{rics.__version__=}")
print(f"{sys.version=}")
!git log --pretty=oneline --abbrev-commit -1
rics.__version__='0.6.0'
sys.version='3.8.10 (default, Mar 15 2022, 12:22:08) \n[GCC 9.4.0]'
c0e4035 (HEAD -> master) Add plotting.pi_ticks
Pi ticks#
Rounding is done so that the ticks start/end to the closest relevant multiple of pi at both ends. This means a multiple of π when half=None or π/2 when half='frac' or half='dec'.
[2]:
from rics.utility import configure_stuff
from rics.utility.plotting import pi_ticks
import numpy as np
import matplotlib.pyplot as plt
configure_stuff()
[3]:
fig, axes = plt.subplots(nrows=3, figsize=(16, 8))
for half_rep, ax in zip(["frac", "dec", None], axes):
x = np.linspace(-11, 10, 1000)
ax.plot(x, np.sin(x))
ax.set_title(f"Tick labels with {half_rep=}")
pi_ticks(ax, half_rep=half_rep)
[ ]: