Skip to content

Commit

Permalink
Update colors and plots
Browse files Browse the repository at this point in the history
  • Loading branch information
simnh committed Feb 28, 2019
1 parent 204b1fb commit b8f426b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/oemof/tabular/examples/scripting/investment.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@

# plot results with plotly
if True:
from oemof.tabular.examples.plots import hourly_plot
from oemof.tabular.tools.plots import hourly_plot

offline.plot(
hourly_plot(
Expand Down
35 changes: 35 additions & 0 deletions src/oemof/tabular/facades.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,3 +772,38 @@ def __init__(self, *args, **kwargs):
'storage': Storage,
'volatile': Volatile,
}

TECH_COLOR_MAP = {
'acaes': 'brown',
'ocgt': 'gray',
'st': "darkgray",
'ccgt': 'lightgray',
'pv': 'gold',
'onshore': 'skyblue',
'offshore': 'darkblue',
'ce': 'olivedrab',
'battery': 'lightsalmon',
'ror': 'aqua',
'phs': 'darkblue',
'reservoir': 'slateblue',
'biomass': 'olivedrab',
"storage": "lightsalmon",
"battery": "lightsalmon",
"import": 'crimson'
}

CARRIER_COLER_MAP = {
'biomass': 'olivedrab',
'lithium': 'lightsalmon',
'electricity': 'darkred',
'hydro': 'aqua',
'hydrogen': 'magenta',
'uranium': 'yellow',
'wind': 'skyblue',
'solar': 'gold',
'gas': 'lightgray',
'lignite': "chocolate",
'coal': "darkgray",
'waste': 'yellowgreen',
'oil': 'black',
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,27 @@
import pandas as pd

import plotly.graph_objs as go
import plotly.offline as offline
# import plotly.offline as offline
from matplotlib import colors

offline.init_notebook_mode()

color = {
'acaes': 'brown',
'gas-ocgt': 'gray',
'gas-ccgt': 'lightgray',
'solar-pv': 'gold',
'wind-onshore': 'skyblue',
'wind-offshore': 'darkblue',
'biomass-ce': 'olivedrab',
'lithium-battery': 'lightsalmon',
'battery': 'lightsalmon',
'electricity': 'lightsalmon',
'hydro-ror': 'aqua',
'hydro-phs': 'darkred',
'hydro-reservoir': 'magenta',
'biomass': 'olivedrab',
'uranium': 'yellow',
'hydro': 'aqua',
'wind': 'skyblue',
'solar': 'gold',
"pv": "gold",
"storage": "lightsalmon",
"ccgt": "lightgray",
'gas': 'lightgray',
'lignite': "chocolate",
'coal': "darkgray",
'waste': 'yellowgreen',
'oil': 'black',
'import': 'pink',
}
#offline.init_notebook_mode()
from oemof.tabular.facades import TECH_COLOR_MAP, CARRIER_COLER_MAP

color = dict(TECH_COLOR_MAP, **CARRIER_COLER_MAP)

for t in TECH_COLOR_MAP:
for c in CARRIER_COLER_MAP:
color['-'.join([c, t])] = TECH_COLOR_MAP[t]

color_dict = {
name: colors.to_hex(color) for name, color in color.items()}


def hourly_plot(
scenario,
bus,
datapath='results',
flexibility = ['import', 'acaes', 'phs', 'lithium_battery', 'battery',
flexibility = ['import', 'acaes', 'phs', 'lithium-battery', 'battery',
'storage'],
aggregate=['coal', 'lignite', 'oil', 'gas', 'waste', 'uranium'],
daily=False):
Expand Down

0 comments on commit b8f426b

Please sign in to comment.