aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/algorithms/params.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-11-29 09:41:37 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2023-11-29 09:41:39 +0100
commitdfeff57244b2d25c135a75e326140794dc4417b4 (patch)
tree0fcd2a1b013264dd5ac717638c080ca95d8e37aa /algorithms/params.py
parenttest.py: formatting fixes (diff)
downloadsorting-algorithms-dfeff57244b2d25c135a75e326140794dc4417b4.tar.gz
sorting-algorithms-dfeff57244b2d25c135a75e326140794dc4417b4.zip
modernize plotting a bit
Use the "object-oriented" interface, fix image size, etc.
Diffstat (limited to '')
-rw-r--r--algorithms/params.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/algorithms/params.py b/algorithms/params.py
index 787cfd1..486cb0e 100644
--- a/algorithms/params.py
+++ b/algorithms/params.py
@@ -132,12 +132,10 @@ class AlgorithmParameters:
ys = [y * units.get_factor() for y in ys]
plot_builder = PlotBuilder()
- plot_builder.show_grid()
- plot_builder.set_xlabel(self._format_plot_xlabel())
- plot_builder.set_ylabel(self._format_plot_ylabel(units))
- #plot_builder.set_yticklabels_scientific()
- plot_builder.set_title(self._format_plot_title())
- plot_builder.plot(xs, ys)
+ title = self._format_plot_title()
+ xlabel = self._format_plot_xlabel()
+ ylabel = self._format_plot_ylabel(units)
+ plot_builder.plot(title, xlabel, ylabel, xs, ys)
if output_path is None:
plot_builder.show()
else: