Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot phase minor locator at base 2 fractions #540

Open
sikersten opened this issue Feb 8, 2024 · 1 comment · Fixed by #559
Open

Plot phase minor locator at base 2 fractions #540

sikersten opened this issue Feb 8, 2024 · 1 comment · Fixed by #559
Labels
enhancement For suggesting enhancements of current functionality plot

Comments

@sikersten
Copy link
Member

sikersten commented Feb 8, 2024

General

  • pyfar version: 0.6.3

Description

Currently, the default ticklabels in phase plots are at 0, +/- $\pi$/2, +/- $\pi$. The minor locators (thin lines) are at multiples of $\pi/6$.
In my opinion, minor locators at multiples of $\pi/4$ or $\pi/8$ are more meaningful (see below). These would be consistent with other typical ways of showing the phase, e.g., degree in multiples of 360/4, cycles/periods in multiples of 1/4...

What I Did

import pyfar as pf
import numpy as np
import matplotlib.pyplot as plt
from pyfar.plot.ticker import MultipleFractionLocator, MultipleFractionFormatter

fig, ax = plt.subplots(3, 1)
signal = pf.signals.noise(1e3)
pf.plot.phase(signal, ax=ax[0])
pf.plot.phase(signal, ax=ax[1])
pf.plot.phase(signal, ax=ax[2])
ax[0].set_title("Multiples of $\pi/6$ (default)")
ax[1].yaxis.set_minor_locator(MultipleFractionLocator(np.pi, 4))
ax[1].set_title("Multiples of $\pi/4$")
ax[2].yaxis.set_minor_locator(MultipleFractionLocator(np.pi, 8))
ax[2].set_title("Multiples of $\pi/8$")

image

@sikersten sikersten added plot enhancement For suggesting enhancements of current functionality labels Feb 8, 2024
@f-brinkmann
Copy link
Member

+1 for changing this, but we have to make sure to redo the base plots for phase in the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For suggesting enhancements of current functionality plot
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants