Skip to content
Snippets Groups Projects
Commit 904e7196 authored by Julian Stürmer's avatar Julian Stürmer
Browse files

Add area offset to settings dictionary

parent 315452dd
No related branches found
No related tags found
No related merge requests found
......@@ -100,8 +100,10 @@ function plot_pg_map(
ax = fig.add_subplot(projection=cartopy.crs.PlateCarree())
ax.set_aspect("equal")
### Set plot settings
settings = _recursive_merge(_default_settings(:plot_pg), settings)
### Set area to plot
xmin, xmax, ymin, ymax = _get_pg_area(network_data, 0.4)
xmin, xmax, ymin, ymax = _get_pg_area(network_data, settings["area_offset"])
ax.set_extent([xmin, xmax, ymin, ymax])
### Get state borders
......@@ -127,8 +129,6 @@ function plot_pg_map(
gl.xformatter = cartopy.mpl.gridliner.LONGITUDE_FORMATTER
gl.yformatter = cartopy.mpl.gridliner.LATITUDE_FORMATTER
### Set plot settings and plot power grid
settings = _recursive_merge(_default_settings(:plot_pg), settings)
_plot_pg!(ax, network_data, settings, figpath, wind)
return nothing
......@@ -283,11 +283,11 @@ function _draw_buses!(
bus_markers = [
mlines.Line2D([], [], color=b["color"], marker=b["marker"], ls="None")
for b in collect(values(settings["Buses"]))
if b["label"] != "nolabel"
if b["label"] != "nolabel" && b["show"] == true
] # markers for legend
bus_labels = [
b["label"] for b in collect(values(settings["Buses"]))
if b["label"] != "nolabel"
if b["label"] != "nolabel" && b["show"] == true
] # labels for legend
### Draw different buses as nodes
......
......@@ -117,6 +117,7 @@ function _default_settings(func::Symbol)
"alpha" => 1,
"cbar_label" => L"\mathrm{wind\, speed\, in\,} m/s"
),
"area_offset" => 0.4,
"draw_ticks" => [true, true, true, true], # whether to show ticks
"draw_legend" => true, # whether to draw a legend
"xlabel" => L"Longitude in $°$",
......@@ -179,11 +180,11 @@ function _default_settings(func::Symbol)
defaults = Dict(
"x_pf_type" => "MVA-loading",
"y_pf_type" => "MVA-loading",
"size" => 15,
"size" => 30, # 15
"cmap" => "seismic", # "coolwarm", # cividis_r
"ec" => "k",
"lw" => .1,
"alpha" => 1.,
"lw" => .5, # .1
"alpha" => .4, # 1.
"xlabel" => "",
"ylabel" => ""
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment