Mb/bar plot fix#140
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates PowerGraphics’ plotting behavior and tests to address issues around stacked bar plots and system-demand plotting, likely driven by upstream changes in PowerSimulations/PowerSystemCaseBuilder and CairoMakie legend behavior.
Changes:
- Update demand-plot tests to build a fresh system with load time series (instead of using
results_uc.system). - Adjust CairoMakie stacked bar plotting to use a single
barplot!call and manually construct legends for stacked bar plots. - Remove the storage-charging (“extra load”) adjustment previously applied to the demand line in
plot_fuel!.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
test/test_plot_creation.jl |
Switches system-demand tests to use a freshly built system with time series. |
src/call_plots.jl |
Changes how plot_fuel! overlays the demand/load line (removes extra_load). |
ext/plot_recipes.jl |
Implements manual legend construction for stacked CairoMakie bar plots. |
Comments suppressed due to low confidence (1)
src/call_plots.jl:758
plot_fuel!no longer adds storage charging to the demand line. This breaks the documented behavior in_plot_demand!(extra_load is meant to make the net-load line coincide with the top of the generation stack when charging is plotted as a negative band), and will make the load line sit below the stack whenever there is charging.
if load
p = _plot_demand!(
p,
result,
backend;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
269
to
+273
| if legend_position == :bottom | ||
| CairoMakie.Legend( | ||
| plot.figure[2, 1], | ||
| plot.axis; | ||
| orientation = :horizontal, | ||
| tellwidth = false, | ||
| tellheight = true, | ||
| legend_kwargs..., | ||
| ) | ||
| if !isnothing(bar_legend_entries) | ||
| bar_labels, bar_colors = bar_legend_entries | ||
| elems = [CairoMakie.PolyElement(; color = c) for c in bar_colors] | ||
| CairoMakie.Legend( |
jd-lara
approved these changes
Jun 7, 2026
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
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.
No description provided.