Python 2.7 Python:如何导入Matplotlib所需的绝对最小值?
我有一个小项目,它使用matplotlib来显示芯片的晶圆图。我正在使用PyInstaller和--onefile选项将单文件Python(2.7)编译成一个可执行文件,以便公司的非Python用户可以在Windows中执行它Python 2.7 Python:如何导入Matplotlib所需的绝对最小值?,python-2.7,matplotlib,python-import,Python 2.7,Matplotlib,Python Import,我有一个小项目,它使用matplotlib来显示芯片的晶圆图。我正在使用PyInstaller和--onefile选项将单文件Python(2.7)编译成一个可执行文件,以便公司的非Python用户可以在Windows中执行它 加载可执行文件需要相当长的时间,最多15秒。作为解决办法,我删除了该程序的所有晶圆图绘制功能,并构建了一个“Lite”版本。在Matplotlib中运行的这个Lite版本相当繁重。你可以试着用压缩剂压缩它。您能将其设置为Web服务吗?绝对不要导入pyplot。mpl中没有
加载可执行文件需要相当长的时间,最多15秒。作为解决办法,我删除了该程序的所有晶圆图绘制功能,并构建了一个“Lite”版本。在Matplotlib中运行的这个Lite版本相当繁重。你可以试着用压缩剂压缩它。您能将其设置为Web服务吗?绝对不要导入
pyplot
。mpl中没有明确的设计目标来启用此功能,因此我认为这并不容易。根据我的经验,在导入matplotlib时,使用py2exe创建的*.exe文件的加载速度比使用PyInstaller快得多。@Blender我可以尝试将其设置为Web服务,但我没有这方面的经验,因此需要一些时间。不过值得一试。
from __future__ import print_function
import math
import matplotlib.pyplot as pyplot
import matplotlib.patches
fig = pyplot.figure(1)
ax = fig.add_subplot(111, aspect='equal')
ax.axis([xAxisMin, xAxisMax, yAxisMin, yAxisMax])
die = matplotlib.patches.Rectangle(coords, dieX, dieY)
ax.add_patch(die)
arc = matplotlib.patches.Arc((0, 0),
width=exclDia, height=exclDia, angle=-90,
theta1=ang, theta2=-ang)
flat = matplotlib.lines.Line2D([-flatX, flatX],
[flatY, flatY])
# Extra code that actually adds everything to the figure
fig.show()
matplotlib.pyplot.figure
matplotlib.patches.Rectangle
matplotlib.patches.Arc
matplotlib.lines.Line2D