当前位置:网站首页>matplotlib ax bar color 设置ax bar的颜色、 透明度、label legend
matplotlib ax bar color 设置ax bar的颜色、 透明度、label legend
2022-07-31 17:38:00 【fK0pS】
matplotlib ax bar color
设置ax bar的颜色
d = nx.degree(g1) print("网络的度分布为:{}".format(d)) degree_sequence_g1 = sorted((d for n, d in g1.degree()), reverse=True) degree_sequence_g2 = sorted((d for n, d in g2.degree()), reverse=True) import numpy as np fig, ax = plt.subplots() ax.bar(*np.unique(degree_sequence_g1, return_counts=True),color='b',alpha=0.3,label='tomor') ax.bar(*np.unique(degree_sequence_g2, return_counts=True),color='r',alpha=0.3,label='normal') ax.set_ylim(ymin = 0, ymax = 450) ax.set_title("Degree histogram") ax.set_xlabel("Degree") ax.set_ylabel("# of Nodes") ax.legend(loc = "best") plt.show() print('plot Degree histogram graph finished!')
边栏推荐
- MySQL---operator
- 华为顶级工程师历时9年总结的“趣谈网络协议”PDF文档,太强了
- MySQL---创建和管理数据库和数据表
- [pytorch] 1.7 pytorch and numpy, tensor and array conversion
- 【愚公系列】2022年07月 Go教学课程 020-Go容器之数组
- 21.支持向量机—核函数的介绍
- Istio介绍
- Huawei mobile phone one-click to open "maintenance mode" to hide all data and make mobile phone privacy more secure
- IP协议从0到1
- After Effects tutorial, How to adjust overexposed snapshots in After Effects?
猜你喜欢
架构师04-应用服务间加密设计和实践
九齐ny3p系列语音芯片替代国产方案KT148A性价比更高420秒长度
每日练习------随机产生一个1-100之间的整数,看能几次猜中。要求:猜的次数不能超过7次,每次猜完之后都要提示“大了”或者“小了”。
All-platform GPU general AI video supplementary frame super-score tutorial
Smart Trash Can (8) - Infrared Tube Sensor (Raspberry Pi pico)
基于WPF重复造轮子,写一款数据库文档管理工具(一)
研发过程中的文档管理与工具
【码蹄集新手村600题】通向公式与程序相结合
MySQL---运算符
IP协议从0到1
随机推荐
【码蹄集新手村600题】通向公式与程序相结合
Intelligent bin (9) - vibration sensor (raspberries pie pico implementation)
go基础部分学习笔记记录
Go record - slice
Masterless replication system (1) - write DB when node fails
Concurrency, Timing and Relativity
The server encountered an internal error that prevented it from fulfilling this request的一种解决办法[通俗易懂]
联邦学习:联邦场景下的多源知识图谱嵌入
保证接口数据安全的10种方式
Kotlin协程:续体、续体拦截器、调度器
获取抖音视频详情 API
Mariabackup实现Mariadb 10.3的增量数据备份
flowable工作流所有业务概念
使用互相关进行音频对齐
adb shell 报错error: device unauthorized
【愚公系列】2022年07月 Go教学课程 020-Go容器之数组
Verilog实现占空比为5/18的9分频
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none 失败
INeuOS industrial Internet operating system, the equipment operational business and "low code" form development tools
MySQL---基本的select语句