当前位置:网站首页>matplotlib散点图自定义坐标轴(文字坐标轴)
matplotlib散点图自定义坐标轴(文字坐标轴)
2022-08-09 22:10:00 【奋斗中的打工人】
效果
代码
import matplotlib.pyplot as plt
import random
x_list = [i for i in range(20)] # 生成X坐标
y_list = [random.randint(1, 10) for i in range(20)] # 生成y坐标
label_list = ["AAAAAA" for i in range(20)] # 生成标签
plt.scatter(x_list, y_list) # 绘制散点图
plt.xticks(x_list, label_list, rotation=270) # 设置标签,并且旋转270度
plt.show()
边栏推荐
猜你喜欢
随机推荐
工作经验-组件封装(拖拽排序组件)
CGLIB源码易懂解析
&& 不是此版本的有效语句分隔符
新增一地公布2022下半年软考报考时间
JuiceFS 在多云存储架构中的应用 | 深势科技分享
对象深复制,面试题
毕昇编译器优化:Lazy Code Motion
全球不用交税的国家,为什么不交
Sun Zhengyi lost 150 billion: it was expensive at the beginning
leetcode:325. 和等于k的最长子数组长度
集合运算样例
量化交易接口系统有哪些稳定性?
&&、||、&、|
Leetcode 98. 验证二叉搜索树
torch.distributed多卡/多GPU/分布式DPP(二)——torch.distributed.all_reduce(reduce_mean)&barrier&控制进程执行顺序&随机数种子
Redis集群
第 1 章 一大波数正在靠近——排序
What is the stability of the quantitative trading interface system?
打包报错 AAPT: error: failed to read PNG signature: file does not start with PNG signature.
34. Fabric2.2 证书目录里各文件作用