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

Add classes for discontinuous axis #48

Merged
merged 6 commits into from
Jan 20, 2025
Merged

Add classes for discontinuous axis #48

merged 6 commits into from
Jan 20, 2025

Conversation

eltos
Copy link
Member

@eltos eltos commented Jan 16, 2025

Description

Adds classes to help creating discontinuous axes

  • Implement classes
  • Add example & test
  • Implement support for multiple discontinuities
import matplotlib.pyplot as plt
import numpy as np
import xplt

fig, ax = plt.subplots(figsize=(4.5, 3))
x = np.linspace(0, 10, 10000)
ax.plot(x, np.sin(2*np.pi*x))
ax.minorticks_on()
ax.grid()

ax.set_xscale('discontinuous_linear', breaks=[(2, 4),(6,9)], space=0.5)
ax.set_yscale('discontinuous_linear', breaks=[(-0.25, 0.25),], space=0.1, hide=True)

Unbenannt

@eltos eltos marked this pull request as ready for review January 17, 2025 14:28
@eltos eltos changed the base branch from main to dev January 20, 2025 10:13
@eltos eltos force-pushed the dev branch 3 times, most recently from 0a6aade to 159677f Compare January 20, 2025 11:10
@eltos eltos changed the title Draft: Add classes for discontinuous axis Add classes for discontinuous axis Jan 20, 2025
@eltos eltos merged commit 01ff19f into dev Jan 20, 2025
15 checks passed
@eltos eltos deleted the eltos-discontinuous-axis branch January 24, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant