当前位置:网站首页>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!')
边栏推荐
- Huawei's top engineers lasted nine years "anecdotal stories network protocol" PDF document summary, is too strong
- Get Douyin Video Details API
- 你辛辛苦苦写的文章可能不是你的原创
- GP 6 overall architecture study notes
- 阿里三面:MQ 消息丢失、重复、积压问题,如何解决?
- Istio介绍
- Flutter 获取状态栏statusbar的高度
- Mariabackup实现Mariadb 10.3的增量数据备份
- UVM RAL模型和内置seq
- 华为手机一键开启“维修模式”隐藏所有数据,让手机隐私更加安全
猜你喜欢
随机推荐
Handling Write Conflicts under Multi-Master Replication (1)-Synchronous and Asynchronous Conflict Detection and Conflict Avoidance
useragent在线查找
抖音根据关键词取视频列表 API
全平台GPU通用AI视频补帧超分教程
TestCafe之如何进行调试
【愚公系列】2022年07月 Go教学课程 021-Go容器之切片操作
[TypeScript] OOP
Last write wins (discards concurrent writes)
Istio介绍
【愚公系列】2022年07月 Go教学课程 022-Go容器之字典
多线程之锁
你辛辛苦苦写的文章可能不是你的原创
Bika LIMS 开源LIMS集—— SENAITE的使用(检测流程)
21.支持向量机—核函数的介绍
GP 6 overall architecture study notes
你辛辛苦苦写的文章可能不是你的原创
C# 之 扑克游戏 -- 21点规则介绍和代码实现
每日练习------随机产生一个1-100之间的整数,看能几次猜中。要求:猜的次数不能超过7次,每次猜完之后都要提示“大了”或者“小了”。
多数据中心操作和检测并发写入
This 985 professor is on fire!After 10 years of Ph.D. supervisor, no one has graduated with a Ph.D.!