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

view: support scatter plot via --style scatter option #1146

Merged
merged 3 commits into from
Mar 9, 2024
Merged

Conversation

falkamelung
Copy link
Contributor

@falkamelung falkamelung commented Feb 15, 2024

Description of proposed changes

This PR supports the scatter plot via matplotlib.pyplot.scatter(), in addition to the existing image plot via matplotlib.pyplot.imshow(), for view.py single plot scenario. This is useful for high-resolution data with lots of holes from unsuccessful unwrapping. Plotting larger than pixel size fills holes like a low-pass filter.

This is controlled via two options: --style with default of image, and --scatter-size with default of 10 point (**2), respectively.

In the image, top is regular view.py (using imshow) and bottom is --style scatter --scatter-size 8
image

Reminders

  • Pass Pre-commit check (green)
  • Pass Codacy code review (green)
  • Pass Circle CI test (green)
  • Make sure that your code follows our style. Use the other functions/files as a basis.
  • If modifying functionality, describe changes to function behavior and arguments in a comment below the function declaration.
  • If adding new functionality, add a detailed description to the documentation and/or an example.

@yunjunz yunjunz requested review from yuankailiu and yunjunz and removed request for yuankailiu March 9, 2024 13:49
+ cli.view.create_parser(): split the new option into `--style` and `--scaltter-size` for simplicity, and for future potential extension to contours

+ view.plot_slice(): pack the xx/yy meshgrid calc into a sub-function `extent2meshgrid()`
@yunjunz yunjunz changed the title view.py: scatterplot support (--scatterplot option) view: support scatter plot via --style scatter option Mar 9, 2024
Copy link
Member

@yunjunz yunjunz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @falkamelung for the PR. The new style looks nice!

@yunjunz yunjunz merged commit 05f803a into main Mar 9, 2024
8 checks passed
@yunjunz yunjunz deleted the view_scatterplot branch March 9, 2024 15:32
@yunjunz yunjunz mentioned this pull request Mar 9, 2024
5 tasks
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.

2 participants