Added folders for Artem's and Vova's modules
This commit is contained in:
parent
c46182e2f8
commit
4e18a8d77b
48
GraphWidget/Graph_example.py
Normal file
48
GraphWidget/Graph_example.py
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
class GraphStatic:
|
||||||
|
@staticmethod
|
||||||
|
def plot(xs: np.ndarray, ys: np.ndarray, params: dict[str, str]) -> plt.Figure:
|
||||||
|
"""
|
||||||
|
строим график через
|
||||||
|
"""
|
||||||
|
ax, fig = plt.subplots(...)
|
||||||
|
|
||||||
|
""""
|
||||||
|
Все методы при этом статичные
|
||||||
|
"""
|
||||||
|
|
||||||
|
GraphStatic.__some_func(1, 2)
|
||||||
|
|
||||||
|
"""
|
||||||
|
И возвращаем Figure
|
||||||
|
"""
|
||||||
|
|
||||||
|
return fig
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def __some_func(arg1, agr2):
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
class GraphStatefull:
|
||||||
|
def __init__(self, xs: np.ndarray, ys: np.ndarray, params: dict[str, str]):
|
||||||
|
self.__xs = xs
|
||||||
|
self.__ys = ys
|
||||||
|
|
||||||
|
self.__params = params
|
||||||
|
ax, fig = plt.subplots(...)
|
||||||
|
|
||||||
|
self.__fig = fig
|
||||||
|
self.__ax = ax
|
||||||
|
|
||||||
|
"""
|
||||||
|
строим график
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __some_func(self, arg1, arg2):
|
||||||
|
self.__ax.do_something(self.__params['something'])
|
||||||
|
|
||||||
|
def get_fig(self) -> plt.Figure:
|
||||||
|
return self.__fig
|
0
GraphWidget/__init__.py
Normal file
0
GraphWidget/__init__.py
Normal file
0
PlotterDialog/__init__.py
Normal file
0
PlotterDialog/__init__.py
Normal file
Loading…
x
Reference in New Issue
Block a user