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

Added an example to save plot to image #2769

Merged
merged 22 commits into from
Aug 10, 2023
Merged

Added an example to save plot to image #2769

merged 22 commits into from
Aug 10, 2023

Conversation

hacknus
Copy link
Contributor

@hacknus hacknus commented Mar 1, 2023

Added an example to save a plot to an image, based on the screenshot example - uses unsafe code as well.
Closes #2470.

@hacknus hacknus changed the title Example to save plot to image Added an example to save plot to image Mar 1, 2023
@emilk
Copy link
Owner

emilk commented Mar 1, 2023

This will be easier when #2676 is merged, with no need for unsafe code!

@hacknus
Copy link
Contributor Author

hacknus commented Mar 1, 2023

Ok, I guess I'll update this example once 2676 is merged.

@hacknus
Copy link
Contributor Author

hacknus commented Mar 29, 2023

adapted to #2676. no unsafe code is required now. Happy to get inputs about this.

examples/save_plot/src/main.rs Outdated Show resolved Hide resolved
examples/save_plot/src/main.rs Outdated Show resolved Hide resolved
examples/save_plot/src/main.rs Outdated Show resolved Hide resolved
@hacknus
Copy link
Contributor Author

hacknus commented Mar 30, 2023

Thanks! Implemented your comments - I still have to do the transformation of the plot location with relative values, but it looks cleaner with egui::Rect

@hacknus
Copy link
Contributor Author

hacknus commented Mar 30, 2023

Oops, ok I removed the unused import that made the CI workflow fail.

@hacknus hacknus requested a review from emilk March 30, 2023 18:41
@hacknus hacknus requested a review from emilk April 2, 2023 20:20
examples/save_plot/Cargo.toml Outdated Show resolved Hide resolved
examples/save_plot/src/main.rs Outdated Show resolved Hide resolved
@hacknus hacknus requested a review from emilk April 19, 2023 17:30
@hacknus
Copy link
Contributor Author

hacknus commented May 17, 2023

I do not get how to mitigate the failed check concerning the Cargo.lock file.

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Looks good! Just a few small nits

examples/save_plot/Cargo.toml Outdated Show resolved Hide resolved
examples/save_plot/src/main.rs Outdated Show resolved Hide resolved
examples/save_plot/src/main.rs Outdated Show resolved Hide resolved
@emilk emilk added the docs and examples Improving and adding documentation and examples label Aug 10, 2023
@emilk emilk merged commit 871041c into emilk:master Aug 10, 2023
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs and examples Improving and adding documentation and examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save plot to image file
2 participants