Я хотел бы отобразить некоторые значения на коробчатой диаграмме Сиборна, например, общее количество наблюдений, среднее значение, значение Mix/Max для каждой серии коробчатой диаграммы. Есть ли способ показать это в сюжете?
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_theme(style="ticks")
# Initialize the figure with a logarithmic x axis
f, ax = plt.subplots(figsize=(7, 6))
ax.set_xscale("log")
# Load the example planets dataset
planets = sns.load_dataset("planets")
# Plot the orbital period with horizontal boxes
sns.boxplot(
planets, x="distance", y="method", hue="method",
whis=[0, 100], width=.6, palette="vlag"
)
# Add in points to show each observation
sns.stripplot(planets, x="distance", y="method", size=4, color=".3")
# Tweak the visual presentation
ax.xaxis.grid(True)
ax.set(ylabel="")
sns.despine(trim=True, left=True)
Я хотел бы отобразить некоторые значения на коробчатой диаграмме Сиборна, например, общее количество наблюдений, среднее значение, значение Mix/Max для каждой серии коробчатой диаграммы. Есть ли способ показать это в сюжете? [code]import seaborn as sns import matplotlib.pyplot as plt
sns.set_theme(style="ticks")
# Initialize the figure with a logarithmic x axis f, ax = plt.subplots(figsize=(7, 6)) ax.set_xscale("log")
# Load the example planets dataset planets = sns.load_dataset("planets")
# Plot the orbital period with horizontal boxes sns.boxplot( planets, x="distance", y="method", hue="method", whis=[0, 100], width=.6, palette="vlag" )
# Add in points to show each observation sns.stripplot(planets, x="distance", y="method", size=4, color=".3")
# Tweak the visual presentation ax.xaxis.grid(True) ax.set(ylabel="") sns.despine(trim=True, left=True) [/code] Пример вывода: [img]https://i.sstatic.net/Ajfwxg8J.png[/img]