-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathplotter.py
More file actions
47 lines (32 loc) · 1.28 KB
/
plotter.py
File metadata and controls
47 lines (32 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# SPDX-FileCopyrightText: 2021-2024 Helmholtz-Zentrum hereon GmbH
#
# SPDX-License-Identifier: LGPL-3.0-only
# Test module that defines a plotter
#
# The plotter in this module has been registered by the rcParams in the plugin
# package
from psyplot.plotter import Formatoption, Plotter
class TestFmt(Formatoption):
"""Some documentation"""
default = None
name = "Test formatoption"
def get_fmt_widget(self, parent, project):
"""Get the formatoption widget to update this formatoption in the GUI"""
from psyplot_gui.compat.qtcompat import QPushButton
button = QPushButton("Test", parent)
button.clicked.connect(lambda: parent.insert_obj(button.text()))
return button
def update(self, value):
pass
class TestFmt2(TestFmt):
"""Another formatoption to the different types of get_fmt_widget"""
name = "Second test formatoption"
def get_fmt_widget(self, parent, project):
"""Get the formatoption widget to update this formatoption in the GUI"""
from psyplot_gui.compat.qtcompat import QPushButton
button = QPushButton("Test", parent)
button.clicked.connect(lambda: parent.insert_obj(2))
return button
class TestPlotter(Plotter):
fmt1 = TestFmt("fmt1")
fmt2 = TestFmt2("fmt2")