【发布时间】:2017-01-05 23:17:56
【问题描述】:
以下面的 seaborn boxplot 为例,来自https://stanford.edu/~mwaskom/software/seaborn/examples/horizontal_boxplot.html
import numpy as np
import seaborn as sns
sns.set(style="ticks", palette="muted", color_codes=True)
# Load the example planets dataset
planets = sns.load_dataset("planets")
# Plot the orbital period with horizontal boxes
ax = sns.boxplot(x="distance", y="method", data=planets,
whis=np.inf, color="c")
# Add in points to show each observation
sns.stripplot(x="distance", y="method", data=planets,
jitter=True, size=3, color=".3", linewidth=0)
# Make the quantitative axis logarithmic
ax.set_xscale("log")
sns.despine(trim=True)
是否可以对条目进行“排名”,从最高到最低(反之亦然)?在这个情节中,“astrometry”应该是最后一个条目,如果从大到小排列的话。
【问题讨论】:
标签: python pandas matplotlib seaborn