Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sankey plot #466

Merged
merged 12 commits into from
Dec 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clean up a bit
  • Loading branch information
mabudz committed Dec 15, 2020
commit 78f4e9d05d2cfa73afbd68fb4a680cbe0b1bb7f3
4 changes: 2 additions & 2 deletions pyam/figures.py
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ def sankey(df, mapping):
right_on='variable')
label_set = set(mapping_df_merged['source']. \
append(mapping_df_merged['target']))
label_series = pd.Series(list(label_set))
label_series = pd.Series(label_set)
for ind, val in label_series.items():
mapping_df_merged.replace(val, ind, inplace=True)
region = get_index_levels(df, 'region')[0]
@@ -58,5 +58,5 @@ def sankey(df, mapping):
hovertemplate='"%{source.label}" to "%{target.label}": \
%{value}<extra></extra>'
))])
fig.update_layout(title_text="%s_%s" % (region, year), font_size=10)
fig.update_layout(title_text="%s %s" % (region, year), font_size=10)
return fig