Plot network
add_cost_pannel(df, fig, preferred_order, tech_colors, plot_additions, ax_loc=[-0.09, 0.28, 0.09, 0.45], **kwargs)
Add a cost pannel to the figure
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
the cost data to plot |
required |
fig
|
Figure
|
the figure object to which the cost pannel will be added |
required |
preferred_order
|
Index
|
index, the order in whiich to plot |
required |
tech_colors
|
dict
|
the tech colors |
required |
plot_additions
|
bool
|
plot the additions |
required |
ax_loc
|
list
|
the location of the cost pannel. Defaults to [-0.09, 0.28, 0.09, 0.45]. |
[-0.09, 0.28, 0.09, 0.45]
|
Source code in workflow/scripts/plot_network.py
add_energy_pannel(df, fig, preferred_order, colors, ax_loc=[-0.09, 0.28, 0.09, 0.45])
Add a cost pannel to the figure
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
the statistics supply output by carrier (from plot_energy map) |
required |
fig
|
Figure
|
the figure object to which the cost pannel will be added |
required |
preferred_order
|
Index
|
index, the order in whiich to plot |
required |
colors
|
Series
|
the colors for the techs, with the correct index and no extra techs |
required |
ax_loc
|
list
|
the pannel location. Defaults to [-0.09, 0.28, 0.09, 0.45]. |
[-0.09, 0.28, 0.09, 0.45]
|
Source code in workflow/scripts/plot_network.py
plot_cost_map(network, opts, base_year=2020, plot_additions=True, capex_only=False, cost_pannel=True, save_path=None)
Plot the cost of each node on a map as well as the line capacities
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network
|
Network
|
the network object |
required |
opts
|
dict
|
the plotting config (snakemake.config["plotting"]) |
required |
base_year
|
int
|
the base year (for cost delta). Defaults to 2020. |
2020
|
capex_only
|
bool
|
do not plot VOM (FOM is in CAPEX). Defaults to False. |
False
|
plot_additions
|
bool
|
plot a map of investments (p_nom_opt vs p_nom). Defaults to True. |
True
|
cost_pannel
|
bool
|
add a bar graph with costs. Defaults to True. |
True
|
save_path
|
PathLike
|
save figure to path (or not if None). Defaults to None. |
None
|
raises: ValueError: if plot_additions and not capex_only
Source code in workflow/scripts/plot_network.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
|
plot_energy_map(network, opts, energy_pannel=True, save_path=None, carrier='AC', plot_ac_imports=False, exclude_batteries=True, components=['Generator', 'Link'])
A map plot of energy, either AC or heat
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network
|
Network
|
the pyPSA network object |
required |
opts
|
dict
|
the plotting options (snakemake.config["plotting"]) |
required |
energy_pannel
|
bool
|
add an anergy pie to the left. Defaults to True. |
True
|
save_path
|
PathLike
|
Fig outp path. Defaults to None (no save). |
None
|
carrier
|
str
|
the energy carrier. Defaults to "AC". |
'AC'
|
plot_ac_imports
|
bool
|
plot electricity imports. Defaults to False. |
False
|
exclude_batteries
|
bool
|
exclude battery dischargers from the supply pie. |
True
|
components
|
list
|
the components to plot. Defaults to ["Generator", "Link"]. |
['Generator', 'Link']
|
raises: ValueError: if carrier is not AC or heat
Source code in workflow/scripts/plot_network.py
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 |
|
plot_map(network, tech_colors, edge_widths, bus_colors, bus_sizes, edge_colors='black', add_ref_edge_sizes=True, add_ref_bus_sizes=True, add_legend=True, bus_unit_conv=PLOT_COST_UNITS, edge_unit_conv=PLOT_CAP_UNITS, ax=None, **kwargs)
Plot the network on a map
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network
|
Network
|
the pypsa network (filtered to contain only relevant buses & links) |
required |
tech_colors
|
dict
|
config mapping |
required |
edge_colors
|
Series | str
|
the series of edge colors |
'black'
|
edge_widths
|
Series
|
the edge widths |
required |
bus_colors
|
Series
|
the series of bus colors |
required |
bus_sizes
|
Series
|
the series of bus sizes |
required |
add_ref_edge_sizes
|
bool
|
add reference line sizes in legend (requires edge_colors=True). Defaults to True. |
True
|
add_ref_bus_sizes
|
bool
|
add reference bus sizes in legend. Defaults to True. |
True
|
ax
|
Axes
|
the plotting ax. Defaults to None (new figure). |
None
|
Source code in workflow/scripts/plot_network.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|
plot_nodal_prices(network, opts, carrier='AC', save_path=None)
A map plot of energy, either AC or heat
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network
|
Network
|
the pyPSA network object |
required |
opts
|
dict
|
the plotting options (snakemake.config["plotting"]) |
required |
save_path
|
PathLike
|
Fig outp path. Defaults to None (no save). |
None
|
carrier
|
str
|
the energy carrier. Defaults to "AC". |
'AC'
|
raises: ValueError: if carrier is not AC or heat
Source code in workflow/scripts/plot_network.py
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 |
|