91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

實現了一個基于Python matplotlib的函數繪圖計算器,可實現二維三維繪圖和解線性方程組,全部圖形界面顯示,界面友好,易操作,有詳細的readMe指導和注釋。

資源截圖

代碼片段和文件信息

import?numpy?as?np
from?numpy?import?inf?nan?e?abs
#?在eval函數中使用到math所以勿刪math
#?from?sympy?import?exp?symbols?integrate?oo?sin?cos?log?tan?pi?factorial?E?erfi
#?from?sympy?import?asin?acos?atan?sinh?cosh?tanh?summation?diff?limit?Integral?Abs?AccumBounds
import?sympy
from?sympy?import?*
#?對話框所需的庫

#?創建畫布需要的庫
from?matplotlib.backends.backend_tkagg?import?FigureCanvasTkAgg
#?創建工具欄需要的庫
from?matplotlib.backends.backend_tkagg?import?NavigationToolbar2Tk
#?快捷鍵需要的庫
from?matplotlib.backend_bases?import?key_press_handler
#?導入畫圖常用的庫
from?matplotlib.pyplot?import?figure
import?matplotlib.pyplot?as?plt
from?mpl_toolkits.mplot3d?import?Axes3D


class?ZoomPan:
????“““
????放大或縮小函數圖像
????移動函數圖像
????“““

????def?__init__(self):
????????self.press?=?None
????????self.cur_xlim?=?None
????????self.cur_ylim?=?None
????????self.x0?=?None
????????self.y0?=?None
????????self.x1?=?None
????????self.y1?=?None
????????self.xpress?=?None
????????self.ypress?=?None

????def?zoom_factory(self?string1?x?y?string?ax?base_scale=2.):
????????def?zoom(event):
????????????nonlocal?x?y?string?string1
????????????cur_xlim?=?ax.get_xlim()
????????????cur_ylim?=?ax.get_ylim()

????????????xdata?=?event.xdata??#?get?event?x?location
????????????ydata?=?event.ydata??#?get?event?y?location

????????????if?event.button?==?‘up‘:
????????????????#?deal?with?zoom?in
????????????????scale_factor?=?1?/?base_scale
????????????elif?event.button?==?‘down‘:
????????????????#?deal?with?zoom?out
????????????????scale_factor?=?base_scale
????????????else:
????????????????#?deal?with?something?that?should?never?happen
????????????????scale_factor?=?1

????????????new_width?=?(cur_xlim[1]?-?cur_xlim[0])?*?scale_factor
????????????new_height?=?(cur_ylim[1]?-?cur_ylim[0])?*?scale_factor

????????????relx?=?(cur_xlim[1]?-?xdata)?/?(cur_xlim[1]?-?cur_xlim[0])
????????????rely?=?(cur_ylim[1]?-?ydata)?/?(cur_ylim[1]?-?cur_ylim[0])

????????????ax.set_xlim([xdata?-?new_width?*?(1?-?relx)
?????????????????????????xdata?+?new_width?*?relx])
????????????ax.set_ylim([ydata?-?new_height?*?(1?-?rely)
?????????????????????????ydata?+?new_height?*?rely])

????????????if?string?!=?““:
????????????????if?string.find(‘log‘)?!=?-1?or?string.find(‘sqrt‘)?!=?-?\
????????????????????????1?or?string.find(‘!‘)?!=?-1:
????????????????????x?=?np.linspace(0.0001?ax.get_xlim()[1]?100)
????????????????elif?string.find(‘asin‘)?!=?-1?or?string.find(‘acos‘)?!=?-1?or?string.find(‘atan‘)?!=?-1:
????????????????????x?=?np.linspace(-1?1?100)
????????????????else:
????????????????????x?=?np.linspace(ax.get_xlim()[0]?ax.get_xlim()[1]?100)
????????????????y?=?[eval(string)?for?i?in?x]
????????????else:
????????????????x?=?[]
????????????????y?=?[]
????????????#?while?len(ax.lines)?!=?0:
????????????#?????ax.lines.pop(0)
????????????ax.lines?=?[]
????????????handle?=?ax.plot(x?y)
????????????ax.grid(True)
????????????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2020-01-09?17:26??基于matplotlib的函數計算器\
?????文件?????????361??2020-01-09?17:27??基于matplotlib的函數計算器\ReadMe.md
?????目錄???????????0??2020-01-09?17:26??基于matplotlib的函數計算器\calculator\
?????目錄???????????0??2020-01-09?17:26??基于matplotlib的函數計算器\calculator\.idea\
?????文件?????????408??2019-06-20?14:17??基于matplotlib的函數計算器\calculator\.idea\calculator.iml
?????文件?????????294??2019-06-20?14:17??基于matplotlib的函數計算器\calculator\.idea\misc.xml
?????文件?????????279??2019-06-20?14:17??基于matplotlib的函數計算器\calculator\.idea\modules.xml
?????文件???????55943??2019-07-01?19:14??基于matplotlib的函數計算器\calculator\.idea\workspace.xml
?????文件???????14087??2019-07-01?19:10??基于matplotlib的函數計算器\calculator\Latex.py
?????文件????????3355??2019-06-29?16:04??基于matplotlib的函數計算器\calculator\LatexMatrix.py
?????文件?????????262??2019-07-01?14:08??基于matplotlib的函數計算器\calculator\Main.py
?????目錄???????????0??2020-01-09?17:26??基于matplotlib的函數計算器\calculator\__pycache__\
?????文件????????8350??2019-07-01?19:11??基于matplotlib的函數計算器\calculator\__pycache__\Latex.cpython-37.pyc
?????文件????????2591??2019-06-29?16:04??基于matplotlib的函數計算器\calculator\__pycache__\LatexMatrix.cpython-37.pyc
?????文件???????10773??2019-07-01?16:43??基于matplotlib的函數計算器\calculator\__pycache__\controler.cpython-37.pyc
?????文件????????5953??2019-06-29?15:38??基于matplotlib的函數計算器\calculator\__pycache__\viewMatrix.cpython-37.pyc
?????文件???????20396??2019-07-01?16:48??基于matplotlib的函數計算器\calculator\__pycache__\viewPlot.cpython-37.pyc
?????文件???????14392??2019-07-01?16:43??基于matplotlib的函數計算器\calculator\controler.py
?????文件????????7100??2019-06-29?15:38??基于matplotlib的函數計算器\calculator\viewMatrix.py
?????文件???????26768??2019-07-01?16:48??基于matplotlib的函數計算器\calculator\viewPlot.py

評論

共有 條評論