简体   繁体   中英

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). I would like to make the y axis more clear by including more values on the axis. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM