Change y-axes to start at 0

This commit is contained in:
Marty Oehme 2022-09-08 13:06:59 +02:00
parent 170ac4747e
commit ced71b6bac
Signed by: Marty
GPG key ID: B7538B8F50A1C800
3 changed files with 12 additions and 0 deletions

View file

@ -140,6 +140,8 @@ financetotals_grouped.columns = financetotals_grouped.columns.to_flat_index()
financetotals_grouped.columns = ['Financetype', 'Year', 'Value'] financetotals_grouped.columns = ['Financetype', 'Year', 'Value']
fig = px.line(financetotals_grouped, x='Year', y='Value', color='Financetype', labels={"Value": "Development aid amount, in millions of USD"}, markers=True, template="seaborn") fig = px.line(financetotals_grouped, x='Year', y='Value', color='Financetype', labels={"Value": "Development aid amount, in millions of USD"}, markers=True, template="seaborn")
# 0-figure
fig.update_yaxes(rangemode="tozero")
fig.show() fig.show()
``` ```
@ -177,6 +179,8 @@ donortotals_grouped = donortotals_grouped.reset_index(['Donortype', 'Year'])
donortotals_grouped.columns = donortotals_grouped.columns.to_flat_index() donortotals_grouped.columns = donortotals_grouped.columns.to_flat_index()
donortotals_grouped.columns = ['Donortype', 'Year', 'Value'] donortotals_grouped.columns = ['Donortype', 'Year', 'Value']
fig = px.line(donortotals_grouped, x='Year', y='Value', color='Donortype', labels={"Value": "Development aid amount, in millions of USD"}, markers=True, template="seaborn") fig = px.line(donortotals_grouped, x='Year', y='Value', color='Donortype', labels={"Value": "Development aid amount, in millions of USD"}, markers=True, template="seaborn")
# 0-figure
fig.update_yaxes(rangemode="tozero")
fig.show() fig.show()
``` ```

View file

@ -181,6 +181,8 @@ financetotals_grouped.columns = financetotals_grouped.columns.to_flat_index()
financetotals_grouped.columns = ['Financetype', 'Year', 'Value'] financetotals_grouped.columns = ['Financetype', 'Year', 'Value']
fig = px.line(financetotals_grouped, x='Year', y='Value', color='Financetype', labels={"Value": "Development aid amount, in millions of USD"}, markers=True, template="seaborn") fig = px.line(financetotals_grouped, x='Year', y='Value', color='Financetype', labels={"Value": "Development aid amount, in millions of USD"}, markers=True, template="seaborn")
# 0-figure
fig.update_yaxes(rangemode="tozero")
fig.show() fig.show()
``` ```
@ -219,6 +221,8 @@ donortotals_grouped = donortotals_grouped.reset_index(['Donortype', 'Year'])
donortotals_grouped.columns = donortotals_grouped.columns.to_flat_index() donortotals_grouped.columns = donortotals_grouped.columns.to_flat_index()
donortotals_grouped.columns = ['Donortype', 'Year', 'Value'] donortotals_grouped.columns = ['Donortype', 'Year', 'Value']
fig = px.line(donortotals_grouped, x='Year', y='Value', color='Donortype', labels={"Value": "Development aid amount, in millions of USD"}, markers=True, template="seaborn") fig = px.line(donortotals_grouped, x='Year', y='Value', color='Donortype', labels={"Value": "Development aid amount, in millions of USD"}, markers=True, template="seaborn")
# 0-figure
fig.update_yaxes(rangemode="tozero")
fig.show() fig.show()
``` ```

View file

@ -204,6 +204,8 @@ financetotals_grouped.columns = financetotals_grouped.columns.to_flat_index()
financetotals_grouped.columns = ['Financetype', 'Year', 'Value'] financetotals_grouped.columns = ['Financetype', 'Year', 'Value']
fig = px.line(financetotals_grouped, x='Year', y='Value', color='Financetype', labels={"Value": "Development aid amount, in millions of USD"}, markers=True, template="seaborn") fig = px.line(financetotals_grouped, x='Year', y='Value', color='Financetype', labels={"Value": "Development aid amount, in millions of USD"}, markers=True, template="seaborn")
# 0-figure
fig.update_yaxes(rangemode="tozero")
fig.show() fig.show()
``` ```
@ -247,6 +249,8 @@ donortotals_grouped = donortotals_grouped.reset_index(['Donortype', 'Year'])
donortotals_grouped.columns = donortotals_grouped.columns.to_flat_index() donortotals_grouped.columns = donortotals_grouped.columns.to_flat_index()
donortotals_grouped.columns = ['Donortype', 'Year', 'Value'] donortotals_grouped.columns = ['Donortype', 'Year', 'Value']
fig = px.line(donortotals_grouped, x='Year', y='Value', color='Donortype', labels={"Value": "Development aid, in millions"}, markers=True, template="seaborn") fig = px.line(donortotals_grouped, x='Year', y='Value', color='Donortype', labels={"Value": "Development aid, in millions"}, markers=True, template="seaborn")
# 0-figure
fig.update_yaxes(rangemode="tozero")
fig.show() fig.show()
``` ```