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

viz.wiggle with 1D patch #462

Open
d-chambers opened this issue Nov 29, 2024 · 1 comment
Open

viz.wiggle with 1D patch #462

d-chambers opened this issue Nov 29, 2024 · 1 comment
Labels
bug Something isn't working viz Related to visualization

Comments

@d-chambers
Copy link
Contributor

Description

viz.wiggle doesn't work with a 1D patch. It probably should.

Example

import dascore as dc

patch = dc.get_example_patch()
patch_agg = patch.mean("distance", dim_reduce="squeeze")
patch_agg.viz.wiggle()  # raises Assertion error, but it should be able to figure it out. 

This kinda works when the patch has 2 dimensions but one dimension is length 1.

Example

import dascore as dc

patch = dc.get_example_patch()
patch_agg = patch.mean("distance", dim_reduce="empty")
patch_agg.viz.wiggle()  # raises Assertion error, but it should be able to figure it out. 

However, in both of these cases it probably makes sense to dispatch to new logic to just plot the Y axis as the data axis (e.g., strain-rate) and the x axis as the remaining axis (e.g., distance).

Versions

  • OS [e.g. Ubuntu 20.04]:
  • DasCore Version [e.g. 0.0.5]:
  • Python Version [e.g. 3.10]:
@d-chambers d-chambers added bug Something isn't working viz Related to visualization labels Nov 29, 2024
@d-chambers
Copy link
Contributor Author

Alternatively, we could just have a viz.plot method which dispatches sensibly to matplotlib.pyplot.plot for the same purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working viz Related to visualization
Projects
None yet
Development

No branches or pull requests

1 participant