icplot 0.1.0__tar.gz → 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {icplot-0.1.0/src/icplot.egg-info → icplot-0.1.1}/PKG-INFO +1 -1
- {icplot-0.1.0 → icplot-0.1.1}/pyproject.toml +1 -1
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/graph/__init__.py +1 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/graph/matplotlib.py +23 -11
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/graph/plot.py +2 -1
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/graph/series.py +9 -0
- icplot-0.1.1/src/icplot/trace/trace.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1/src/icplot.egg-info}/PKG-INFO +1 -1
- icplot-0.1.0/src/icplot/__init__.py +0 -3
- {icplot-0.1.0 → icplot-0.1.1}/LICENSE +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/README.md +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/setup.cfg +0 -0
- /icplot-0.1.0/src/icplot/py.typed → /icplot-0.1.1/src/icplot/__init__.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/cairo_interface.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/color.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/convert.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/gantt/__init__.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/gantt/gantt.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/gantt/gantt_renderer.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/gantt/pgfgantt.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/geometry.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/graph/axis.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/graph/generator.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/image_utils.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/main_cli.py +0 -0
- /icplot-0.1.0/src/icplot/trace/trace.py → /icplot-0.1.1/src/icplot/py.typed +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/tex.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot/trace/__init__.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot.egg-info/SOURCES.txt +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot.egg-info/dependency_links.txt +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot.egg-info/entry_points.txt +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot.egg-info/requires.txt +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/src/icplot.egg-info/top_level.txt +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/test/test_cairo_interface.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/test/test_gantt_chart.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/test/test_image_utils.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/test/test_line_plots.py +0 -0
- {icplot-0.1.0 → icplot-0.1.1}/test/test_tex_interface.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: icplot
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Utilities for generating plots and graphics for technical reports.
|
|
5
5
|
Author-email: "James Grogan, Irish Centre for High End Computing" <james.grogan@ichec.ie>
|
|
6
6
|
Project-URL: Repository, https://git.ichec.ie/performance/toolshed/icplot
|
|
@@ -23,27 +23,35 @@ class MatplotlibColorMap(ColorMap):
|
|
|
23
23
|
super().__init__(label, mpl.colormaps[label])
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
def _set_decorations(
|
|
27
|
-
ax
|
|
26
|
+
def _set_decorations(axs, plot: Plot):
|
|
27
|
+
ax = axs[0]
|
|
28
|
+
if plot.legend != "none":
|
|
29
|
+
ax.legend(loc=plot.legend)
|
|
28
30
|
if plot.x_axis.label:
|
|
29
31
|
ax.set_xlabel(plot.x_axis.label)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
for idx, y_axis in enumerate(plot.y_axes):
|
|
33
|
+
if y_axis.label:
|
|
34
|
+
axs[idx].set_ylabel(y_axis.label)
|
|
35
|
+
if y_axis.ticks:
|
|
36
|
+
axs[idx].set_yticks(y_axis.resolved_ticks)
|
|
32
37
|
if plot.x_axis.ticks:
|
|
33
38
|
ax.set_xticks(plot.x_axis.resolved_ticks)
|
|
34
|
-
if plot.y_axis.ticks:
|
|
35
|
-
ax.set_yticks(plot.y_axis.resolved_ticks)
|
|
36
39
|
if plot.title:
|
|
37
40
|
ax.set_title(plot.title)
|
|
38
41
|
|
|
39
42
|
|
|
40
|
-
def _plot_line(
|
|
43
|
+
def _plot_line(axs, series: LinePlotSeries):
|
|
44
|
+
if not series.position_right:
|
|
45
|
+
ax = axs[0]
|
|
46
|
+
else:
|
|
47
|
+
ax = axs[1]
|
|
41
48
|
ax.plot(
|
|
42
49
|
series.x,
|
|
43
50
|
series.y,
|
|
44
51
|
label=series.label,
|
|
45
52
|
color=series.color.as_list(),
|
|
46
53
|
marker=series.marker,
|
|
54
|
+
drawstyle=series.drawstyle,
|
|
47
55
|
)
|
|
48
56
|
|
|
49
57
|
|
|
@@ -56,9 +64,10 @@ def _plot_image(ax, series: ImageSeries):
|
|
|
56
64
|
ax.axis("off")
|
|
57
65
|
|
|
58
66
|
|
|
59
|
-
def _plot_series(
|
|
67
|
+
def _plot_series(axs, series: PlotSeries):
|
|
68
|
+
ax = axs[0]
|
|
60
69
|
if series.series_type == "line":
|
|
61
|
-
_plot_line(
|
|
70
|
+
_plot_line(axs, cast(LinePlotSeries, series))
|
|
62
71
|
elif series.series_type == "scatter":
|
|
63
72
|
_plot_scatter(ax, cast(ScatterPlotSeries, series))
|
|
64
73
|
elif series.series_type == "image":
|
|
@@ -81,11 +90,14 @@ def render(
|
|
|
81
90
|
apply_colors(cmap, plot)
|
|
82
91
|
|
|
83
92
|
fig, ax = plt.subplots()
|
|
93
|
+
axs = [ax]
|
|
94
|
+
if len(plot.y_axes) > 1:
|
|
95
|
+
axs.append(ax.twinx())
|
|
84
96
|
|
|
85
97
|
for series in plot.series:
|
|
86
|
-
_plot_series(
|
|
98
|
+
_plot_series(axs, series)
|
|
87
99
|
|
|
88
|
-
_set_decorations(
|
|
100
|
+
_set_decorations(axs, plot)
|
|
89
101
|
|
|
90
102
|
_render(fig, path)
|
|
91
103
|
|
|
@@ -21,9 +21,10 @@ class Plot(BaseModel):
|
|
|
21
21
|
legend_label: str = ""
|
|
22
22
|
name: str = ""
|
|
23
23
|
x_axis: PlotAxis = PlotAxis()
|
|
24
|
-
|
|
24
|
+
y_axes: list[PlotAxis] = [PlotAxis()]
|
|
25
25
|
plot_type: str = ""
|
|
26
26
|
series: list[PlotSeries] = []
|
|
27
|
+
legend: str = "upper left"
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
class GridPlot(Plot):
|
|
@@ -8,12 +8,16 @@ from icplot.color import Color
|
|
|
8
8
|
class PlotSeries(BaseModel):
|
|
9
9
|
"""
|
|
10
10
|
A data series in a plot, such as a single line in a line-plot
|
|
11
|
+
|
|
12
|
+
:param position_right: allows the series to be plotted on the right y-axis.
|
|
13
|
+
:type position_right: bool, optional
|
|
11
14
|
"""
|
|
12
15
|
|
|
13
16
|
label: str
|
|
14
17
|
color: Color = Color()
|
|
15
18
|
series_type: str = ""
|
|
16
19
|
highlight: bool = False
|
|
20
|
+
position_right: bool = False
|
|
17
21
|
|
|
18
22
|
|
|
19
23
|
class ImageSeries(PlotSeries):
|
|
@@ -29,12 +33,17 @@ class ImageSeries(PlotSeries):
|
|
|
29
33
|
class LinePlotSeries(PlotSeries):
|
|
30
34
|
"""
|
|
31
35
|
A plot series for line plots
|
|
36
|
+
|
|
37
|
+
:param drawstyle: Naming comes from matplotlib API, allows for various square plots,
|
|
38
|
+
default is a normal point to point line plot.
|
|
39
|
+
:type drawstyle: str, optional
|
|
32
40
|
"""
|
|
33
41
|
|
|
34
42
|
x: list
|
|
35
43
|
y: list
|
|
36
44
|
marker: str = "o"
|
|
37
45
|
series_type: str = "line"
|
|
46
|
+
drawstyle: str = "default"
|
|
38
47
|
|
|
39
48
|
|
|
40
49
|
class ScatterPlotSeries(PlotSeries):
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: icplot
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Utilities for generating plots and graphics for technical reports.
|
|
5
5
|
Author-email: "James Grogan, Irish Centre for High End Computing" <james.grogan@ichec.ie>
|
|
6
6
|
Project-URL: Repository, https://git.ichec.ie/performance/toolshed/icplot
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|