Skip to content

Commit caa160f

Browse files
committed
rename update_line to add_line
1 parent 779fc7a commit caa160f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

adafruit_displayio_layout/widgets/cartesian.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,12 @@ def update_pointer(self, x: int, y: int) -> None:
603603
self._pointer.x = self.plot_line_point[-1][0]
604604
self._pointer.y = self.plot_line_point[-1][1]
605605

606-
def update_line(self, x: int, y: int) -> None:
607-
"""updater_line function
608-
helper function to update line in the plane
606+
def add_line(self, x: int, y: int) -> None:
607+
"""add_line function.
608+
609+
add line to the plane.
610+
multiple calls create a line-plot graph.
611+
609612
:param int x: ``x`` coordinate in the local plane
610613
:param int y: ``y`` coordinate in the local plane
611614
:return: None
@@ -625,7 +628,9 @@ def update_line(self, x: int, y: int) -> None:
625628
def clear_plot(self, palette_index=5):
626629
"""clear_plot function.
627630
628-
clear plotted lines
631+
clear all added lines
632+
(clear line-plot graph)
633+
629634
:param int palette_index: color palett index. Defaults to 5
630635
:return: None
631636
rtype: None

examples/displayio_layout_cartesian_lineplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
# first point without a wait.
5757
my_plane.update_line(0, 0)
5858
for x, y in data:
59-
my_plane.update_line(x, y)
59+
my_plane.add_line(x, y)
6060
time.sleep(0.5)
6161

6262
while True:

0 commit comments

Comments
 (0)