小编bel*_*liz的帖子

ValueError: Axes 实例参数未在图中找到,同名问题没有答案

我正在尝试创建一个 seaborn Facetgrid 来绘制我的 dataFrame 十项全能中所有列的正态分布。数据如下所示:

      P100m   Plj  Psp  Phj  P400m  P110h   Ppv  Pdt  Pjt  P1500
0       938  1061  773  859    896    911   880  732  757    752
1       839   975  870  749    887    878   880  823  863    741
2       814   866  841  887    921    939   819  778  884    691
3       872   898  789  878    848    879   790  790  861    804
4       892   913  742  803    816    869  1004  789  854    699
 ...   ...  ...  ...    ...    ...   ...  ...  ... …
Run Code Online (Sandbox Code Playgroud)

python seaborn

6
推荐指数
1
解决办法
1366
查看次数

git@gitlab.com:权限被拒绝(公钥)。致命:无法从远程存储库读取

我正在使用 macOS Catalina。我已经在 GitLab 上有一个存储库并SSH-key分配了一个。现在我想从终端创建另一个存储库。我执行以下操作:

git config user.name my_name
git config user.email my_email
git init
Run Code Online (Sandbox Code Playgroud)

然后我得到这个:

Initialized empty Git repository in directory
Run Code Online (Sandbox Code Playgroud)

到现在为止还挺好。

git remote add origin git@gitlab.com:my_name/repo.git
git add .
git commit -m 'commit'
git push -u origin master
Run Code Online (Sandbox Code Playgroud)

然后我收到以下错误:

git@gitlab.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

然后我转到我已经拥有的存储库并尝试推送到那里,一切正常,所以我想我对SSH-key. 我知道这是互联网上一个非常常见的问题,但没有一个答案能解决我的问题。

iterm ssh-keys git-push gitlab git-init

5
推荐指数
2
解决办法
1万
查看次数

如何将 matplotlib 动画转换为 HTML5 <video> 标签

下面是 matplolib 动画图的代码,这里是如何保存它。

from IPython.display import HTML
import matplotlib.pyplot as plt
import matplotlib.animation 
import numpy as np

t = np.linspace(0,2*np.pi)
x = np.sin(t)

fig, ax = plt.subplots()
ax.axis([0,2*np.pi,-1,1])
l, = ax.plot([],[])

def animate(i):
    l.set_data(t[:i], x[:i]);

ani = matplotlib.animation.FuncAnimation(fig, animate, frames=len(t));
#HTML(ani.to_jshtml())

ani.to_html5_video()
Run Code Online (Sandbox Code Playgroud)

我基本上做的是将生成的代码复制到一个基本的 html 脚本中,如下所示:

<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>My First Heading</h1>

<video width="432" height="288" controls autoplay loop> BLABLA </video>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

图表未显示,但标题和视频菜单在那里。为什么?我该如何解决?

html python matplotlib

4
推荐指数
1
解决办法
4165
查看次数

标签 统计

python ×2

git-init ×1

git-push ×1

gitlab ×1

html ×1

iterm ×1

matplotlib ×1

seaborn ×1

ssh-keys ×1