From c7fa856f95eaf1d48f10cea02ce76e5652d6b45d Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Wed, 11 Sep 2024 14:39:17 +0200 Subject: [PATCH 1/6] Update jdh_statistics.ipynb --- jdh_statistics.ipynb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jdh_statistics.ipynb b/jdh_statistics.ipynb index c0f55c5..89b703b 100644 --- a/jdh_statistics.ipynb +++ b/jdh_statistics.ipynb @@ -40,6 +40,9 @@ "import requests\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", + "from matplotlib import cm\n", + "import numpy as np\n", + "\n", "\n", "\n", "# API URL\n", @@ -74,7 +77,8 @@ "\n", " # Plot the data\n", " my_colors = [(x/10.0, x/20.0, 0.75) for x in range(len(articles_per_year))]\n", - " articles_per_year.plot(kind='bar', xlabel='Year', ylabel='Number of Articles', title='Articles Published per Year', color=my_colors)\n", + " colors = cm.inferno_r(np.linspace(.4, .8, 4))\n", + " articles_per_year.plot(kind='bar', xlabel='Year', ylabel='Number of Articles', title='Articles Published per Year', color=colors)\n", " # Set y-axis ticks to integers only\n", " plt.yticks(range(int(articles_per_year.max()) + 1))\n", "\n", From 946e4ca9e32faf23bd7b1088f38ae08a74ec258c Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Wed, 11 Sep 2024 14:43:25 +0200 Subject: [PATCH 2/6] Update jdh_statistics.ipynb --- jdh_statistics.ipynb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/jdh_statistics.ipynb b/jdh_statistics.ipynb index 89b703b..6e78bac 100644 --- a/jdh_statistics.ipynb +++ b/jdh_statistics.ipynb @@ -76,8 +76,7 @@ " articles_per_year = df['publication_year'].value_counts().sort_index()\n", "\n", " # Plot the data\n", - " my_colors = [(x/10.0, x/20.0, 0.75) for x in range(len(articles_per_year))]\n", - " colors = cm.inferno_r(np.linspace(.4, .8, 4))\n", + " colors = cm.inferno_r(np.linspace(.4, .8, 5))\n", " articles_per_year.plot(kind='bar', xlabel='Year', ylabel='Number of Articles', title='Articles Published per Year', color=colors)\n", " # Set y-axis ticks to integers only\n", " plt.yticks(range(int(articles_per_year.max()) + 1))\n", @@ -159,7 +158,8 @@ " abstracts_per_year = df['submitted_date'].value_counts().sort_index()\n", "\n", " # Plot the data as a line plot\n", - " abstracts_per_year.plot(kind='line', marker='o', xlabel='Year', ylabel='Number of Abstracts', title='Abstracts submitted per Year')\n", + " colors = cm.inferno_r(np.linspace(.4, .8, 4))\n", + " abstracts_per_year.plot(kind='line', marker='o', xlabel='Year', ylabel='Number of Abstracts', title='Abstracts submitted per Year', color=colors)\n", "\n", " plt.show()\n", "\n", @@ -243,7 +243,8 @@ "pivot_table = pd.pivot_table(df, values='status', index='submitted_date', columns='callpaper', aggfunc='count', fill_value=0)\n", "\n", "# Plot the data as a line plot\n", - "ax = pivot_table.plot(kind='line', marker='o', xlabel='Year', ylabel='Number of Abstracts', title='Abstracts submitted per Year by Callpaper Type')\n", + "colors = cm.inferno_r(np.linspace(.4, .8, 4))\n", + "ax = pivot_table.plot(kind='line', marker='o', xlabel='Year', ylabel='Number of Abstracts', title='Abstracts submitted per Year by Callpaper Type' color=colors)\n", "\n", "# Get the handles and labels of the current axes\n", "handles, labels = ax.get_legend_handles_labels()\n", @@ -516,7 +517,8 @@ "issues_per_year = df['year'].value_counts().sort_index()\n", "\n", "# Plotting\n", - "issues_per_year.plot(kind='bar')\n", + "colors = cm.inferno_r(np.linspace(.4, .8, 4))\n", + "issues_per_year.plot(kind='bar', color=colors)\n", "plt.title('Number of Issues Closed per Year')\n", "plt.xlabel('Year')\n", "plt.ylabel('Number of Issues Closed')\n", From e9ebf147341825cc317e446d6e42b82f9cf15838 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Wed, 11 Sep 2024 14:45:48 +0200 Subject: [PATCH 3/6] Update jdh_statistics.ipynb --- jdh_statistics.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdh_statistics.ipynb b/jdh_statistics.ipynb index 6e78bac..bafbd28 100644 --- a/jdh_statistics.ipynb +++ b/jdh_statistics.ipynb @@ -244,7 +244,7 @@ "\n", "# Plot the data as a line plot\n", "colors = cm.inferno_r(np.linspace(.4, .8, 4))\n", - "ax = pivot_table.plot(kind='line', marker='o', xlabel='Year', ylabel='Number of Abstracts', title='Abstracts submitted per Year by Callpaper Type' color=colors)\n", + "ax = pivot_table.plot(kind='line', marker='o', xlabel='Year', ylabel='Number of Abstracts', title='Abstracts submitted per Year by Callpaper Type', color=colors)\n", "\n", "# Get the handles and labels of the current axes\n", "handles, labels = ax.get_legend_handles_labels()\n", From 5847fe845a3e4cb762c2632b6dcf6dc4a1f129ce Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Wed, 11 Sep 2024 14:48:50 +0200 Subject: [PATCH 4/6] Update jdh_statistics.ipynb --- jdh_statistics.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jdh_statistics.ipynb b/jdh_statistics.ipynb index bafbd28..9d72331 100644 --- a/jdh_statistics.ipynb +++ b/jdh_statistics.ipynb @@ -353,8 +353,9 @@ "status_counts = df['status'].value_counts()\n", "\n", "# Plot a pie chart\n", + "colors = cm.inferno_r(np.linspace(.4, .8, 4))\n", "plt.figure(figsize=(8, 8)) # Set the figure size\n", - "plt.pie(status_counts, labels=status_counts.index, autopct='%1.1f%%', startangle=140)\n", + "plt.pie(status_counts, labels=status_counts.index, autopct='%1.1f%%', startangle=140, colors=colors)\n", "plt.title('Article Status Distribution')\n", "plt.show()" ] From f474fcc40a059c740db41228ef09ceb6804bc451 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Wed, 11 Sep 2024 14:55:00 +0200 Subject: [PATCH 5/6] Update jdh_statistics.ipynb --- jdh_statistics.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdh_statistics.ipynb b/jdh_statistics.ipynb index 9d72331..6ba1a9f 100644 --- a/jdh_statistics.ipynb +++ b/jdh_statistics.ipynb @@ -353,7 +353,7 @@ "status_counts = df['status'].value_counts()\n", "\n", "# Plot a pie chart\n", - "colors = cm.inferno_r(np.linspace(.4, .8, 4))\n", + "colors = cm.inferno_r(np.linspace(.4, .8, 3))\n", "plt.figure(figsize=(8, 8)) # Set the figure size\n", "plt.pie(status_counts, labels=status_counts.index, autopct='%1.1f%%', startangle=140, colors=colors)\n", "plt.title('Article Status Distribution')\n", From 452e9a0011f7b9528683d723500fb6e259331f3c Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Wed, 11 Sep 2024 14:58:16 +0200 Subject: [PATCH 6/6] Update jdh_statistics.ipynb --- jdh_statistics.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jdh_statistics.ipynb b/jdh_statistics.ipynb index 6ba1a9f..95b18ed 100644 --- a/jdh_statistics.ipynb +++ b/jdh_statistics.ipynb @@ -383,7 +383,8 @@ "grouped_data = df.groupby(['issue_title', 'status']).size().unstack(fill_value=0)\n", "\n", "# Plot a stacked bar chart\n", - "grouped_data.plot(kind='bar', stacked=True, figsize=(10, 7))\n", + "colors = cm.inferno_r(np.linspace(.4, .8, 4))\n", + "grouped_data.plot(kind='bar', stacked=True, figsize=(10, 7), color=colors)\n", "plt.title('Number of Articles by Status and Issue')\n", "plt.xlabel('Issue Title')\n", "plt.ylabel('Number of Articles')\n",