简体   繁体   中英

Changing y-axis ticks

I'm working on some data analysis and I'm trying to make some changes to the y-axis of my plot. I'm using Seaborn and using distplot() . Currently this is my plot:

图像1

but I'm trying to achieve this

图2

Am wondering is there a specific argument I need to include in distplot() , or is there some formatting method I could use?

You can edit y ticks with ax.set_yticks (or plt.yticks ) as here:

custom_ticks = [0, 0.03, 0.1, 0.16, 0.23, 0.27, 0.32, 0.35, 0.39, 0.41]
ax.set_yticks(custom_ticks)

So this default plot:

在此处输入图像描述

becomes:

在此处输入图像描述

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