小编The*_*Guy的帖子

尝试使用 PyInstaller 时出现权限错误

尝试使用 PyInstaller 部署 Kivy 应用程序时,即使在使用管理员 CMD 时,我也会收到 Permission Denied 错误。该文件夹为每个用户提供所有打开的编辑选项。Python 具有防火墙访问权限。如何解决这个问题?

PS C:\Users\theguy\Documents\Python\myapp-build> python -m PyInstaller --name "MyApp" "./"
422 INFO: PyInstaller: 3.3.1
422 INFO: Python: 3.6.5
424 INFO: Platform: Windows-10-10.0.17134-SP0
425 INFO: wrote C:\Users\theguy\Documents\Python\myapp-build\myapp.spec
426 INFO: UPX is not available.
427 INFO: Extending PYTHONPATH with paths
['C:\\Users\\theguy\\Documents\\Python',
 'C:\\Users\\theguy\\Documents\\Python\\myapp-build']
428 INFO: checking Analysis
428 INFO: Building Analysis because out00-Analysis.toc is non existent
429 INFO: Initializing module dependency graph...
432 INFO: Initializing module graph hooks...
434 INFO: Analyzing base_library.zip ...
3859 …
Run Code Online (Sandbox Code Playgroud)

pyinstaller python-3.x kivy anaconda

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

Matlab Signal Toolbox的tfestimate()的Python版本?

Matlab的tfestimate()是否有Python版本?我已经研究了控制工具箱,但它仅提供线性传递函数。

python matlab numpy scipy

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

在Matplotlib中使用连字符或减号与乳胶的兼容性

我遇到的问题是使用matplotlib.pyplot创建的pgf输出连字符而不是减号,而Latex无法解释.

我试图使用此处找到的解决方案,但它会在tick标签中将数字从整数更改为浮点数(即2000变为2000.0).我正在寻找一个解决方案,修复标志,但保持在pyplot中的默认格式.

有任何想法吗?以下示例.

myplot.py

import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter

def math_formatter(x, pos):
    return "$%s$" % x 

plt.figure()
plt.plot([1,2,3,4,5,6,7],[-1,-2,3,4,5,6,7])

axis = plt.gca()
axis.xaxis.set_major_formatter(FuncFormatter(math_formatter))
axis.yaxis.set_major_formatter(FuncFormatter(math_formatter)) 

plt.show()
Run Code Online (Sandbox Code Playgroud)

mylatex.tex

\documentclass{article}

\usepackage{pgf}

\begin{document}
    \begin{figure}[H]
        \centering
        \input{myplot.pgf}
     \end{figure}
\end{document}
Run Code Online (Sandbox Code Playgroud)

如果您在没有formatter参数的情况下进行绘图,则会将标准格式设置为int,但latex将不会将连字符识别为减号.如果使用formatter参数,则所有int都将成为浮点数.

我正在寻找一个解决方案,其中连字符被更改为减号,但无论参数(int或float或其他),刻度将表现为pyplot的默认行为(连字符是减号).

python matplotlib pdflatex

4
推荐指数
2
解决办法
3481
查看次数