[英]seaborn modify y axis (log scale) to show more values
I have plotted a boxplot using seaborn, the y axis is uses a log scale (time in miliseconds). 我已经使用seaborn绘制了箱线图,y轴使用了对数刻度(时间以毫秒为单位)。 I would like to make the y axis more clear by including more values on the axis.
我想通过在轴上包含更多值来使y轴更清晰。 How could I achieve that?
我该如何实现? The code used and the graph generated are below.
使用的代码和生成的图形如下。
ax2 = sns.boxplot(x="xVals", y="Time", data=df2, whis=[0, 100])
ax2.set(yscale="log")
Try 尝试
ax2.xaxis.set_major_locator(ticker.MultipleLocator(5))
ax2.xaxis.set_minor_locator(ticker.MultipleLocator(1))
More info: 更多信息:
https://matplotlib.org/api/ticker_api.html https://matplotlib.org/api/ticker_api.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.