我是靠谱客的博主 烂漫巨人,这篇文章主要介绍python 画图 pytorch plt 等python画图, 坐标轴显示不完全, 例如:python 柱状图带曲线拟合:RL的qlearning训练中,reward的画图,类似下图,现在分享给大家,希望可以做个参考。

python画图, 坐标轴显示不完全, 例如:

变成:

plt.xticks(x)

python 柱状图带曲线拟合:

复制代码
1
2
3
4
5
6
import matplotlib.pyplot as plt import seaborn as sns sns.distplot(data) plt.xlabel('x轴Delay level', fontsize=14) plt.ylabel('y轴Distribution', fontsize=14) plt.show()

RL的qlearning训练中,reward的画图,类似下图

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import matplotlib.pyplot as plt import numpy as np def running_mean(x, N): cumsum = np.cumsum(np.insert(x, 0, 0)) return (cumsum[N:] - cumsum[:-N]) / N def plot_result(rew_list):#res_list is the reward list data eps, rews = np.array(rew_list).T smoothed_rews = running_mean(rews, 10) plt.plot(eps[-len(smoothed_rews):], smoothed_rews) plt.plot(eps, rews, color='grey', alpha=0.3) plt.xlabel('Episode') plt.ylabel('Total Reward') plt.show()

https://openai.com/blog/better-exploration-with-parameter-noise/

https://github.com/openai/baselines/blob/master/baselines/deepq/build_graph.py

https://spinningup.openai.com/en/latest/spinningup/bench.html#halfcheetah-pytorch-versions

https://github.com/openai/spinningup/blob/master/spinup/utils/plot.py

最后

以上就是烂漫巨人最近收集整理的关于python 画图 pytorch plt 等python画图, 坐标轴显示不完全, 例如:python 柱状图带曲线拟合:RL的qlearning训练中,reward的画图,类似下图的全部内容,更多相关python内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(76)

评论列表共有 0 条评论

立即
投稿
返回
顶部