-
Notifications
You must be signed in to change notification settings - Fork 89
Add FilledArea plot item to fill between two lines #199
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds a new FilledArea plot item that fills the area between two lines defined by x values and corresponding y_min and y_max values. API: FilledArea::new(name, &xs, &ys_min, &ys_max) Useful for visualizing: - Confidence intervals - Min-max ranges - Uncertainty bands Features: - Customizable fill color (Color32) - Optional stroke around boundaries - Follows existing plot item patterns Closes emilk#190
Collaborator
|
Great, thank you for the PR! This is something I wanted to have in the library soon, good timing :) Can you please add a demo example with controls? E.g.
Thank you! |
- Created filled_area example with sin(x) and adjustable bounds - Added controls for delta_lower and delta_upper offsets - Integrated into demo gallery - Added workspace dependencies
Collaborator
Collaborator
|
Oh and please run |
- Export FilledArea in lib.rs for public use - Fix polygon rendering by using Mesh instead of convex_polygon - Creates proper triangle strips to avoid connecting first/last points - Fills area correctly between upper and lower boundaries
Collaborator
Collaborator
|
There are some CI failures, pls fix them. |
- Wrap Mesh in Arc as required by egui Shape::Mesh API - Fix unused variable warning (ui -> _ui) - Add std::sync::Arc import - Generate screenshots using UPDATE_SNAPSHOTS=1 cargo test - Screenshots now show actual filled area demo with interactive controls
Collaborator
|
Closing in favor of #202 with some fixes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Summary
Adds a new
FilledAreaplot item that fills the area between two lines, useful for visualizing confidence intervals, ranges, and uncertainty bands.Changes
FilledAreastruct inegui_plot/src/items/filled_area.rsFilledArea::new(name, &xs, &ys_min, &ys_max)takes plain f64 slicesExample Usage