当前位置:网站首页>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源码易懂解析
- How to insist to use procedural system?
- setter与getter访问器属性——数据驱动显示
- R语言拟合ARIMA模型并使用拟合模型进行预测推理:使用forecast函数计算ARIMA模型未来值(包含时间点、预测值、两个置信区间)
- 干涉BGP的选路---社团属性
- R语言ggstatsplot包grouped_ggscatterstats函数可视化分组散点图、并添加假设检验结果(包含样本数、统计量、效应大小及其置信区间、显著性、组间两两比较、贝叶斯假设)
- 注意力引导网络用于视网膜图像分割
- leetcode:321. 拼接最大数
- &&、||、&、|
猜你喜欢
随机推荐
[WeChat applet development (8)] Summary of audio background music playback problems
Good future, want to be a second new Oriental
Socket发送缓冲区接收缓冲区快问快答
Leetcode 530. 二叉搜索树的最小绝对差
Redis
A1. Prefix Flip (Easy Version)
ElasticSearcch集群
CV复习:softmax代码实现
C. Mere Array
集合运算样例
Leetcode 98. 验证二叉搜索树
tiup cluster template
R语言ggplot2可视化:使用ggpubr包的ggerrorplot函数可视化误差线(可视化不同水平均值点以及se标准误差)、设置add参数为dotplot添加点阵图
three.js镂空圆球拖拽变形js特效
Analyses the development status quo of stock trading
leetcode:325. 和等于k的最长子数组长度
HUAWEI CLOUD escorts the whole process of "Wandering Ark" for the first time, creating a popular brand
华为云全流程护航《流浪方舟》破竹首发,打造口碑爆款
反射机制篇
如何坚持使用程序化系统?