From 4e18a8d77b8b739f805f7e46b6b9b31b811c36b1 Mon Sep 17 00:00:00 2001 From: dm1sh Date: Tue, 17 Oct 2023 21:45:58 +0300 Subject: [PATCH] Added folders for Artem's and Vova's modules --- GraphWidget/Graph_example.py | 48 ++++++++++++++++++++++++++++++++++++ GraphWidget/__init__.py | 0 PlotterDialog/__init__.py | 0 3 files changed, 48 insertions(+) create mode 100644 GraphWidget/Graph_example.py create mode 100644 GraphWidget/__init__.py create mode 100644 PlotterDialog/__init__.py diff --git a/GraphWidget/Graph_example.py b/GraphWidget/Graph_example.py new file mode 100644 index 0000000..19a4964 --- /dev/null +++ b/GraphWidget/Graph_example.py @@ -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 \ No newline at end of file diff --git a/GraphWidget/__init__.py b/GraphWidget/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/PlotterDialog/__init__.py b/PlotterDialog/__init__.py new file mode 100644 index 0000000..e69de29