Home > front end >  Putting points on each vertex of a graph (plot)
Putting points on each vertex of a graph (plot)

Time:12-04

I would like to put points at each vertex of this graph but I don't know how to do it, would you have an idea? enter image description here Code:

import pandas as pd 
import matplotlib.pyplot as plt
import seaborn as sns

members = pd.read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-09-22/members.csv")

expeditions = pd.read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-09-22/expeditions.csv")

success = members[members["success"]==True]
success = success.reset_index()
plt.figure(figsize=(17,8))
success_saisons = success.drop(success[(success["season"]=="Unknown")].index)
success_saisons.groupby("season")['success'].count().plot(linewidth=6)
plt.title("Répartition des succès en fonction des saisons",fontsize=15)
plt.ylabel("nombre de membres ayant réussi", fontsize = 12)

CodePudding user response:

In order to plot the vertex you can specify the marker size and shape using matplotlib marker and markersize arguments.

Code:

import pandas as pd 
import matplotlib.pyplot as plt
import seaborn as sns

members = pd.read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-09-22/members.csv")

expeditions = pd.read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-09-22/expeditions.csv")

success = members[members["success"]==True]
success = success.reset_index()
plt.figure(figsize=(17,8))
success_saisons = success.drop(success[(success["season"]=="Unknown")].index)
success_saisons.groupby("season")['success'].count().plot(linewidth=6, marker="o", markersize=12)
plt.title("Répartition des succès en fonction des saisons",fontsize=15)
plt.ylabel("nombre de membres ayant réussi", fontsize = 12)
plt.show()

Output:

enter image description here

  • Related