Skip to content
Snippets Groups Projects
Commit 5d427234 authored by Maxence Larrieu's avatar Maxence Larrieu
Browse files

reduce bottom margin

parent 5e4c88d0
No related branches found
No related tags found
No related merge requests found
2-produce-graph/pie--datacite-client.png

56.9 KiB | W: | H:

2-produce-graph/pie--datacite-client.png

59.2 KiB | W: | H:

2-produce-graph/pie--datacite-client.png
2-produce-graph/pie--datacite-client.png
2-produce-graph/pie--datacite-client.png
2-produce-graph/pie--datacite-client.png
  • 2-up
  • Swipe
  • Onion skin
2-produce-graph/pie--datacite-type.png

50.1 KiB | W: | H:

2-produce-graph/pie--datacite-type.png

52.1 KiB | W: | H:

2-produce-graph/pie--datacite-type.png
2-produce-graph/pie--datacite-type.png
2-produce-graph/pie--datacite-type.png
2-produce-graph/pie--datacite-type.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -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")
......
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment