Skip to content

Mb/bar plot fix#140

Merged
jd-lara merged 3 commits into
mainfrom
mb/bar-plot-fix
Jun 7, 2026
Merged

Mb/bar plot fix#140
jd-lara merged 3 commits into
mainfrom
mb/bar-plot-fix

Conversation

@m-bossart

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 thread ext/plot_recipes.jl
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(
@m-bossart m-bossart requested a review from jd-lara June 5, 2026 22:42
@jd-lara jd-lara merged commit ec1d466 into main Jun 7, 2026
6 checks passed
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.

3 participants