Public API Reference

PowerGraphics.plot_dataframe!Method
plot_dataframe!(plot, df)
plot_dataframe!(plot, df, time_range)

Plots data from a DataFrames.DataFrame where each row represents a time period and each column represents a trace

Arguments

  • plot: existing plot handle, such as the result of plot()
  • df::DataFrames.DataFrame: DataFrame where each row represents a time period and each column represents a trace.

If only the DataFrame is provided, it must have a column of DateTime values.

  • time_range::Union{DataFrames.DataFrame, Array, StepRange}: The time periods of the data

Accepted Key Words

  • curtailment::Bool: plot the curtailment with the variable
  • set_display::Bool = true: set to false to prevent the plots from displaying
  • save::String = "file_path": set a file path to save the plots
  • format::String = "png": set a different format for saving a PlotlyJS plot. Options include "png", "pdf" and "eps"
  • seriescolor::Array: Set different colors for the plots
  • title::String = "Title": Set a title for the plots
  • stack::Bool = true: stack plot traces
  • bar::Bool : create bar plot
  • nofill::Bool : force empty area fill
  • stair::Bool: Make a stair plot instead of a stack plot
source
PowerGraphics.plot_dataframeMethod
plot_dataframe(df)
plot_dataframe(df, time_range)

Plots data from a DataFrames.DataFrame where each row represents a time period and each column represents a trace

Arguments

  • df::DataFrames.DataFrame: DataFrame where each row represents a time period and each column represents a trace.

If only the DataFrame is provided, it must have a column of DateTime values.

  • time_range::Union{DataFrames.DataFrame, Array, StepRange}: The time periods of the data

Example

var_name = :P__ThermalStandard
df = PowerSimulations.read_variables_with_keys(results, names = [var_name])[var_name]
time_range = PowerSimulations.get_realized_timestamps(results)
plot = plot_dataframe(df, time_range)

Accepted Key Words

  • curtailment::Bool: plot the curtailment with the variable
  • set_display::Bool = true: set to false to prevent the plots from displaying
  • save::String = "file_path": set a file path to save the plots
  • format::String = "png": set a different format for saving a PlotlyJS plot. Options include "png", "pdf" and "eps"
  • seriescolor::Array: Set different colors for the plots
  • title::String = "Title": Set a title for the plots
  • stack::Bool = true: stack plot traces
  • bar::Bool : create bar plot
  • nofill::Bool : force empty area fill
  • stair::Bool: Make a stair plot instead of a stack plot
source
PowerGraphics.plot_demand!Method
plot_demand!(plot, result)
plot_demand!(plot, system)

Plots the demand in the system.

Arguments

Accepted Key Words

  • linestyle::Symbol = :dash : set line style
  • title::String: Set a title for the plots
  • horizon::Int64: To plot a shorter window of time than the full results
  • initial_time::DateTime: To start the plot at a different time other than the results initial time
  • aggregate::String = "System", "PowerLoad", or "Bus": aggregate the demand by PowerSystems.System, PowerSystems.PowerLoad, or PowerSystems.Bus, rather than by generator
  • set_display::Bool = true: set to false to prevent the plots from displaying
  • save::String = "file_path": set a file path to save the plots
  • format::String = "png": set a different format for saving a PlotlyJS plot. Options include "png", "pdf" and "eps"
  • seriescolor::Array: Set different colors for the plots
  • title::String = "Title": Set a title for the plots
  • stack::Bool = true: stack plot traces
  • bar::Bool : create bar plot
  • nofill::Bool : force empty area fill
  • stair::Bool: Make a stair plot instead of a stack plot
  • filter_func::Function =PowerSystems.get_available: filter components included in plot
  • palette : color palette from load_palette
source
PowerGraphics.plot_fuel!Method
plot_fuel!(plot, results)

Plots a stack plot of the results by fuel type and assigns each fuel type a specific color.

Arguments

Accepted Key Words

  • generator_mapping_file = "file_path" : file path to yaml defining generator category by fuel and primemover
  • variables::Union{Nothing, Vector{Symbol}} = nothing : specific variables to plot
  • slacks::Bool = true : display slack variables
  • load::Bool = true : display load line
  • curtailment::Bool = true: To plot the curtailment in the stack plot
  • set_display::Bool = true: set to false to prevent the plots from displaying
  • save::String = "file_path": set a file path to save the plots
  • format::String = "png": set a different format for saving a PlotlyJS plot. Options include "png", "pdf" and "eps"
  • seriescolor::Array: Set different colors for the plots
  • title::String = "Title": Set a title for the plots
  • stack::Bool = true: stack plot traces
  • bar::Bool : create bar plot
  • nofill::Bool : force empty area fill
  • stair::Bool: Make a stair plot instead of a stack plot
  • filter_func::Function =PowerSystems.get_available: filter components included in plot
  • palette : Color palette as from load_palette.
source
PowerGraphics.plot_fuelMethod
plot_fuel(results)

Plots a stack plot of the results by fuel type and assigns each fuel type a specific color.

Arguments

res = solve_op_problem!(OpProblem)
plot = plot_fuel(res)

Accepted Key Words

  • generator_mapping_file = "file_path" : file path to yaml defining generator category by fuel and primemover
  • variables::Union{Nothing, Vector{Symbol}} = nothing : specific variables to plot
  • slacks::Bool = true : display slack variables
  • load::Bool = true : display load line
  • curtailment::Bool = true: To plot the curtailment in the stack plot
  • set_display::Bool = true: set to false to prevent the plots from displaying
  • save::String = "file_path": set a file path to save the plots
  • format::String = "png": set a different format for saving a PlotlyJS plot. Options include "png", "pdf" and "eps"
  • seriescolor::Array: Set different colors for the plots
  • title::String = "Title": Set a title for the plots
  • stack::Bool = true: stack plot traces
  • bar::Bool : create bar plot
  • nofill::Bool : force empty area fill
  • stair::Bool: Make a stair plot instead of a stack plot
  • filter_func::Function =PowerSystems.get_available: filter components included in plot
source
PowerGraphics.plot_powerdata!Method
plot_powerdata!(plot, powerdata)

Makes a plot from a PowerAnalytics.PowerData object, such as the result of PowerAnalytics.get_generation_data

Arguments

  • plot: existing plot handle, such as the result of plot() (optional)
  • powerdata::PowerAnalytics.PowerData: The PowerData object to be plotted

Accepted Key Words

  • combine_categories::Bool = false : plot category values or each value in a category
  • curtailment::Bool: plot the curtailment with the variable
  • set_display::Bool = true: set to false to prevent the plots from displaying
  • save::String = "file_path": set a file path to save the plots
  • format::String = "png": set a different format for saving a PlotlyJS plot. Options include "png", "pdf" and "eps"
  • seriescolor::Array: Set different colors for the plots
  • title::String = "Title": Set a title for the plots
  • stack::Bool = true: stack plot traces
  • bar::Bool : create bar plot
  • nofill::Bool : force empty area fill
  • stair::Bool: Make a stair plot instead of a stack plot
source
PowerGraphics.plot_powerdataMethod
plot_powerdata(powerdata)

Makes a plot from a PowerAnalytics.PowerData object, such as the result of PowerAnalytics.get_generation_data

Arguments

  • powerdata::PowerAnalytics.PowerData: The PowerData object to be plotted

Accepted Key Words

  • combine_categories::Bool = false : plot category values or each value in a category
  • curtailment::Bool: plot the curtailment with the variable
  • set_display::Bool = true: set to false to prevent the plots from displaying
  • save::String = "file_path": set a file path to save the plots
  • format::String = "png": set a different format for saving a PlotlyJS plot. Options include "png", "pdf" and "eps"
  • seriescolor::Array: Set different colors for the plots
  • title::String = "Title": Set a title for the plots
  • stack::Bool = true: stack plot traces
  • bar::Bool : create bar plot
  • nofill::Bool : force empty area fill
  • stair::Bool: Make a stair plot instead of a stack plot
source
PowerGraphics.plot_results!Method
plot_results!(plot, results)

Makes a plot from a results dictionary

Arguments

  • plot: existing plot handle, such as the result of plot() (optional)
  • results::Dict{String, DataFrame}: The results to be plotted

Accepted Key Words

  • combine_categories::Bool = false : plot category values or each value in a category
  • curtailment::Bool: plot the curtailment with the variable
  • set_display::Bool = true: set to false to prevent the plots from displaying
  • save::String = "file_path": set a file path to save the plots
  • format::String = "png": set a different format for saving a PlotlyJS plot. Options include "png", "pdf" and "eps"
  • seriescolor::Array: Set different colors for the plots
  • title::String = "Title": Set a title for the plots
  • stack::Bool = true: stack plot traces
  • bar::Bool : create bar plot
  • nofill::Bool : force empty area fill
  • stair::Bool: Make a stair plot instead of a stack plot
source
PowerGraphics.plot_resultsMethod
plot_results(results)

Makes a plot from a results dictionary object

Arguments

  • results::Dict{String, DataFrame: The results to be plotted

Accepted Key Words

  • combine_categories::Bool = false : plot category values or each value in a category
  • curtailment::Bool: plot the curtailment with the variable
  • set_display::Bool = true: set to false to prevent the plots from displaying
  • save::String = "file_path": set a file path to save the plots
  • format::String = "png": set a different format for saving a PlotlyJS plot. Options include "png", "pdf" and "eps"
  • seriescolor::Array: Set different colors for the plots
  • title::String = "Title": Set a title for the plots
  • stack::Bool = true: stack plot traces
  • bar::Bool : create bar plot
  • nofill::Bool : force empty area fill
  • stair::Bool: Make a stair plot instead of a stack plot
source
PowerGraphics.reportMethod
report(res::IS.Results, out_path::String, design_template::String)

This function uses Weave.jl to either generate a LaTeX or HTML file based on the report_design.jmd (Julia markdown) file that it reads.

An example template is available here

Arguments

  • results::IS.Results: The results to be plotted
  • out_path::String: folder path to the location the report should be generated
  • design_template::String = "file_path": directs the function to the julia markdown report design, the default

Example

results = solve_op_problem!(OpModel)
out_path = "/Users/downloads"
report(results, out_path, template)

Accepted Key Words

  • doctype::String = "md2html": create an HTML, default is PDF via latex
  • backend::Plots.AbstractBackend = Plots.gr(): sets the Plots.jl backend
source
PowerGraphics.save_plotMethod
save_plot(plot, filename)

Saves plot to specified filename

Arguments

  • plot: plot object
  • filename::String : save to filename

Example

res = solve_op_problem!(OpProblem)
plot = plot_fuel(res)
save_plot(plot, "my_plot.png")

Accepted Key Words (currently only implemented for PlotlyJS backend)

  • width::Union{Nothing,Int}=nothing
  • height::Union{Nothing,Int}=nothing
  • scale::Union{Nothing,Real}=nothing
source