小编Paa*_*lon的帖子

如何在 matplotlib 中将 rc 参数 `usetex=True` 与其他字体一起使用

我想用乳胶和其他字体进行绘图,但似乎只有乳胶字体可用。如何使用 usetex 启用其他字体?

import numpy as np
import matplotlib.pyplot as plt

plt.rc('text', usetex=True)
plt.rc('font', family='Arial')

plt.imshow(np.random.randn(100, 100))
plt.title('This is a test')
plt.xlabel('$x$')
plt.ylabel('$y$')
plt.show()
Run Code Online (Sandbox Code Playgroud)

绘制的图像

python matplotlib python-3.x

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

如何在不指定目标目录的情况下进行 git clone 项目名称?

我使用 macOS 和 Ubuntu。我想将某个项目 git clonehttps://github.com/Project/project.git到特定目录$HOME/git。我看到了这个页面:如何将 Git 存储库克隆到特定文件夹中?,但它需要明确指定其项目名称,例如:git clone https://github.com/Project/project.git $HOME/git/project。如何在不指定项目名称的情况下 git 克隆它们?

[Add1] 如果我 git clone 像:git clone https://github.com/Project/project.git $HOME/git 那么我遇到了fatal: destination path '/home/paalon/git' already exists and is not an empty directory. [Add2] 我想在$HOME/git目录下克隆 git 管理的项目。我想将状态ls $HOME/git显示设置为project1/ project2/ project3/.

git

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

哪个更好用`Int((n + 1)/ 2)`,`round(Int,(n + 1)/ 2)`或`Int((n + 1)// 2)`?

我有一个奇数n,想(n+1)/2用作数组索引.计算指数的最佳方法是什么?我想出来使用Int((n+1)/2),round(Int, (n+1)/2))Int((n+1)//2).哪个更好或者不是我需要太担心它们?

julia

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

标签 统计

git ×1

julia ×1

matplotlib ×1

python ×1

python-3.x ×1