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

size img

same size of images
parent 28ac4b6d
No related branches found
No related tags found
No related merge requests found
2-produce-graph/pie--datacite-client.png

45.5 KiB | W: | H:

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

56.7 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

38.8 KiB | W: | H:

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

48.4 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
......@@ -21,16 +21,18 @@ df_type = df["resourceTypeGeneral"].value_counts()
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.pie(df_type, colors = colors, autopct=lambda p: '{:.0f}%'.format(round(p)) if p > 1 else '', startangle = 160)
## auto pct only if value > 1
plt.legend(df_type.index, loc = (0.7, -0.1) )
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.savefig("pie--datacite-type.png")
print(f"\ngraph produced pie--datacite-type.png")
plt.show()
# print(len(df))
\ No newline at end of file
......@@ -31,6 +31,7 @@ colors = [plt.cm.Set3(i) for i in range(len(df_client))]
#colors = sns.color_palette('pastel')[0:len(df_client)]
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)
......
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