From ced71b6bac8d0d5f07d479ae6b3a01e911934d4b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 8 Sep 2022 13:06:59 +0200 Subject: [PATCH] Change y-axes to start at 0 --- _drivers-of-inequality-benin.qmd | 4 ++++ _drivers-of-inequality-uganda.qmd | 4 ++++ _drivers-of-inequality-vietnam.qmd | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/_drivers-of-inequality-benin.qmd b/_drivers-of-inequality-benin.qmd index 1cd0402..6da54e8 100644 --- a/_drivers-of-inequality-benin.qmd +++ b/_drivers-of-inequality-benin.qmd @@ -140,6 +140,8 @@ financetotals_grouped.columns = financetotals_grouped.columns.to_flat_index() 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") +# 0-figure +fig.update_yaxes(rangemode="tozero") 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 = ['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") +# 0-figure +fig.update_yaxes(rangemode="tozero") fig.show() ``` diff --git a/_drivers-of-inequality-uganda.qmd b/_drivers-of-inequality-uganda.qmd index a69dc49..f97e382 100644 --- a/_drivers-of-inequality-uganda.qmd +++ b/_drivers-of-inequality-uganda.qmd @@ -181,6 +181,8 @@ financetotals_grouped.columns = financetotals_grouped.columns.to_flat_index() 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") +# 0-figure +fig.update_yaxes(rangemode="tozero") 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 = ['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") +# 0-figure +fig.update_yaxes(rangemode="tozero") fig.show() ``` diff --git a/_drivers-of-inequality-vietnam.qmd b/_drivers-of-inequality-vietnam.qmd index d42922e..9b09157 100644 --- a/_drivers-of-inequality-vietnam.qmd +++ b/_drivers-of-inequality-vietnam.qmd @@ -204,6 +204,8 @@ financetotals_grouped.columns = financetotals_grouped.columns.to_flat_index() 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") +# 0-figure +fig.update_yaxes(rangemode="tozero") 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 = ['Donortype', 'Year', 'Value'] 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() ```