Skip to content

Commit 2dc3e61

Browse files
committed
correcting logging limits
1 parent 302ac15 commit 2dc3e61

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

circuitpython_uplot/logging.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
CircuitPython logging data graph
1111
12-
* Author(s): Jose D. Montoya
12+
* Author: Jose D. Montoya
1313
1414
1515
"""
@@ -87,6 +87,8 @@ def __init__(
8787
dtype=np.int16,
8888
)
8989
plot._plot_palette[9] = limits_color
90+
else:
91+
self._limits = None
9092

9193
self.draw_points(plot, x, y, fill)
9294

@@ -163,7 +165,8 @@ def draw_points(self, plot: Plot, x: list, y: list, fill: bool = False) -> None:
163165
:return: None
164166
"""
165167
self.clear_plot(plot)
166-
168+
if self._limits:
169+
self._draw_limit_lines(plot)
167170
self.draw_new_lines(plot, x, y, fill)
168171

169172
def draw_new_lines(self, plot: Plot, x: list, y: list, fill: bool = False) -> None:
@@ -215,17 +218,17 @@ def draw_new_lines(self, plot: Plot, x: list, y: list, fill: bool = False) -> No
215218
def _draw_limit_lines(self, plot: Plot) -> None:
216219
draw_line(
217220
plot._plotbitmap,
218-
plot._newxmin,
221+
plot._newxmin + 1,
219222
self._limits[0],
220-
plot._newxmax,
223+
plot._newxmax - 1,
221224
self._limits[0],
222225
9,
223226
)
224227
draw_line(
225228
plot._plotbitmap,
226-
plot._newxmin,
229+
plot._newxmin + 1,
227230
self._limits[1],
228-
plot._newxmax,
231+
plot._newxmax - 1,
229232
self._limits[1],
230233
9,
231234
)

pyproject.toml

+7-12
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,19 @@
33
# SPDX-License-Identifier: MIT
44

55
[build-system]
6-
requires = [
7-
"setuptools",
8-
"wheel",
9-
"setuptools-scm",
10-
]
6+
requires = ["setuptools", "wheel", "setuptools-scm"]
117

128
[project]
139
name = "circuitpython-uplot"
1410
description = "framework to display different plots in displayio. similar to widget"
1511
version = "0.0.0+auto.0"
1612
readme = "README.rst"
17-
authors = [
18-
{name = "JDM", email = "uplot@mailmeto.mozmail.com"}
19-
]
20-
urls = {Homepage = "https://github.com/jposada202020/CircuitPython_uplot"}
13+
authors = [{ name = "JDM", email = "uplot@mailmeto.mozmail.com" }]
14+
urls = { Homepage = "https://github.com/jposada202020/CircuitPython_uplot" }
2115
keywords = [
2216
"circuitpython",
2317
"uplot",
18+
"microplot",
2419
"bar",
2520
"stackplot",
2621
"fillbetween",
@@ -41,7 +36,7 @@ keywords = [
4136
"plot",
4237
"plotter",
4338
]
44-
license = {text = "MIT"}
39+
license = { text = "MIT" }
4540
classifiers = [
4641
"Intended Audience :: Developers",
4742
"Topic :: Software Development :: Libraries",
@@ -56,5 +51,5 @@ dynamic = ["dependencies", "optional-dependencies"]
5651
packages = ["circuitpython_uplot"]
5752

5853
[tool.setuptools.dynamic]
59-
dependencies = {file = ["requirements.txt"]}
60-
optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}
54+
dependencies = { file = ["requirements.txt"] }
55+
optional-dependencies = { optional = { file = ["optional_requirements.txt"] } }

0 commit comments

Comments
 (0)