diff --git a/2-produce-graph/pie--datacite-client.png b/2-produce-graph/pie--datacite-client.png index 7c77e1c570d5499cc81d34d59b94f32c5af02864..c35d4c357f48943bf3dc533ecb8f89da2dcb8a44 100644 Binary files a/2-produce-graph/pie--datacite-client.png and b/2-produce-graph/pie--datacite-client.png differ diff --git a/2-produce-graph/pie--datacite-type.png b/2-produce-graph/pie--datacite-type.png index d5803abc94fe5a009543c39f26f06840a86c5a22..ea6c4e515c9d0397a0ff9773dbcd21dba9e759a7 100644 Binary files a/2-produce-graph/pie--datacite-type.png and b/2-produce-graph/pie--datacite-type.png differ diff --git a/2-produce-graph/pie-data-type.py b/2-produce-graph/pie-data-type.py index 91500472a06b833e3e3985f49d78994404fedcdb..074b8f73397df72af4dff9f41b60d92656188450 100644 --- a/2-produce-graph/pie-data-type.py +++ b/2-produce-graph/pie-data-type.py @@ -15,14 +15,13 @@ df_type = df["resourceTypeGeneral"].value_counts() -#define Seaborn color palette to use -# a set of color via plt +#define a color palette to use ### see color palett https://matplotlib.org/stable/users/explain/colors/colormaps.html colors = [plt.cm.Pastel1(i) for i in range(len(df_type))] random.shuffle(colors) ## so that blue is not more the first item plt.subplots(figsize=(10, 7)) -# plt.subplots_adjust(0.5, 1 , 0, 1) # pour modifier la taille du pie +# plt.subplots_adjust(1, 0.01 , 0.9, 0.2) # pour modifier la taille du pie plt.pie(df_type, colors = colors, autopct=lambda p: '{:.0f}%'.format(round(p)) if p > 1 else '', startangle = 160) ## auto pct only if value > 1 @@ -30,6 +29,7 @@ plt.legend(df_type.index, loc = (0.85, 0.2) ) plt.title(f"Type of datasets", fontsize = 20, x = 0.5, y = 1.03, alpha = 0.6) plt.suptitle(f"n = {len(df)}", fontsize = 11, x = 0.5, y = 0.9, alpha = 0.6) +plt.tight_layout(h_pad = 0) plt.savefig("pie--datacite-type.png") print(f"\ngraph produced pie--datacite-type.png") diff --git a/2-produce-graph/pie-datacite-client.py b/2-produce-graph/pie-datacite-client.py index 7665d0ad80ddf31d7f8ba966a05d483efa911c39..eb92d9008775b226c7c18dea96ec1902c112823c 100644 --- a/2-produce-graph/pie-datacite-client.py +++ b/2-produce-graph/pie-datacite-client.py @@ -34,6 +34,7 @@ plt.subplots(figsize=(10, 7)) plt.pie(df_client, labels = df_client.index, colors = colors, autopct='%.0f%%') plt.title(f"Distribution of datasets by DataCite client", fontsize = 20, x = 0.5, y = 1.03, alpha = 0.6) plt.suptitle(f"n = {len(df)}", fontsize = 11, x = 0.5, y = 0.90, alpha = 0.6) +plt.tight_layout(h_pad = 0) plt.savefig("pie--datacite-client.png") print(f"\ngraph produced pie--datacite-client.png")