当前位置:网站首页>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!')边栏推荐
- The new telecom "routine", my dad was tricked!
- 【Yugong Series】July 2022 Go Teaching Course 020-Array of Go Containers
- 2022 Android interview summary (with interview questions | source code | interview materials)
- Go basic part study notes
- adb shell error error: device unauthorized
- 【luogu P8326】Fliper(图论)(构造)(欧拉回路)
- Concurrency, Timing and Relativity
- Mariabackup实现Mariadb 10.3的增量数据备份
- 智能垃圾桶(八)——红外对管传感器(树莓派pico)
- 每日练习------随机产生一个1-100之间的整数,看能几次猜中。要求:猜的次数不能超过7次,每次猜完之后都要提示“大了”或者“小了”。
猜你喜欢

TestCafe之如何进行调试

All-platform GPU general AI video supplementary frame super-score tutorial

Go basic part study notes

ThreadLocal

MySQL---operator

Bika LIMS 开源LIMS集—— SENAITE的使用(检测流程)

selenium的常见方法及使用

2022 Android interview summary (with interview questions | source code | interview materials)

Apache EventMesh 分布式事件驱动多运行时

Intelligent bin (9) - vibration sensor (raspberries pie pico implementation)
随机推荐
杰理语音芯片ic玩具芯片ic的介绍_AD14NAD15N全系列开发
Golang 小数操作之判断几位小数点与四舍五入
【pytorch】pytorch 自动求导、 Tensor 与 Autograd
Bika LIMS 开源LIMS集—— SENAITE的使用(检测流程)
MySQL---子查询
2022年Android 面经总结(附含面试题 | 源码 | 面试资料)
JS基础小练习
cas与自旋锁(轻量级锁就是自旋锁吗)
Handling write conflicts under multi-master replication (3) - Convergence to a consistent state and custom conflict resolution logic
selenium的常见方法及使用
[TypeScript] OOP
京东获取商品历史价格信息 API
MySQL---aggregate function
adb shell 报错error: device unauthorized
MySQL---Subqueries
【愚公系列】2022年07月 Go教学课程 022-Go容器之字典
MySQL---sort and pagination
go记录之——slice
iNeuOS工业互联网操作系统,设备运维业务和“低代码”表单开发工具
C# 之 扑克游戏 -- 21点规则介绍和代码实现