Skip to content

Conversation

@michalsustr
Copy link
Collaborator

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.

Useful for visualizing:

  • Confidence intervals
  • Min-max ranges
  • Uncertainty bands

Features:

  • Customizable fill color (Color32)
  • Optional stroke around boundaries
  • Follows existing plot item patterns

Added items to the public API

+pub struct egui_plot::FilledArea
+impl egui_plot::FilledArea

@michalsustr michalsustr added the include in changelog This change will be included in the changelog label Nov 30, 2025
@michalsustr
Copy link
Collaborator Author

Contributed by @Eshaan-byte

@michalsustr
Copy link
Collaborator Author

Hmm not sure why screenshots keep failing. Will take a look later.

@michalsustr michalsustr force-pushed the ms/filled-area branch 2 times, most recently from d2f8ef1 to 528a504 Compare December 3, 2025 12:01
@michalsustr
Copy link
Collaborator Author

Sorry, there seems to be some issue with the screenshot testing, we're looking at it

Eshaan-byte and others added 5 commits December 4, 2025 22:14
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 #190

Add filled_area example to demo gallery

- 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

Fix FilledArea rendering and export

- 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

Fix Arc<Mesh> compilation error and add screenshots

- 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

screenshot

fixes

tags

fixes

lint

screenshots

rm

add

some change

rebase fixes
any img
@michalsustr michalsustr merged commit e6fb403 into main Dec 4, 2025
10 checks passed
@michalsustr michalsustr deleted the ms/filled-area branch December 4, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

include in changelog This change will be included in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants