diff --git a/.pylintrc b/.pylintrc index 0d186f0..4408bdc 100644 --- a/.pylintrc +++ b/.pylintrc @@ -80,7 +80,7 @@ class-rgx=[A-Z_][a-zA-Z0-9_]+$ const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ docstring-min-length=-1 function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ -good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_,cs,TVOC,bar,rx,ry,x0,y0,y1,x1,logging,fillbetween,ucartesian,y2,map,pie,shade +good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_,cs,TVOC,bar,rx,ry,x0,y0,y1,x1,logging,fillbetween,cartesian,y2,map,pie,shade include-naming-hint=no inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ diff --git a/circuitpython_uplot/bar.py b/circuitpython_uplot/bar.py index 2e28749..04e8e4b 100644 --- a/circuitpython_uplot/bar.py +++ b/circuitpython_uplot/bar.py @@ -15,7 +15,7 @@ """ try: - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Plot except ImportError: pass from math import sin, cos, ceil @@ -37,7 +37,7 @@ class Bar: def __init__( self, - plot: Uplot, + plot: Plot, x: list, y: list, color: int = 0xFFFFFF, @@ -49,7 +49,7 @@ def __init__( max_value=None, ) -> None: """ - :param Uplot plot: Plot object for the scatter to be drawn + :param Plot plot: Plot object for the scatter to be drawn :param list x: x data :param list y: y data :param int color: boxes color. Defaults to const:``0xFFFFFF`` @@ -233,7 +233,7 @@ def _create_projections(self, xstart: int, indice: int, color_lenght: int): ) def _draw_rectangle( - self, plot: Uplot, x: int, y: int, width: int, height: int, color: int + self, plot: Plot, x: int, y: int, width: int, height: int, color: int ) -> None: """ Helper function to draw bins rectangles diff --git a/circuitpython_uplot/ucartesian.py b/circuitpython_uplot/cartesian.py similarity index 98% rename from circuitpython_uplot/ucartesian.py rename to circuitpython_uplot/cartesian.py index e16bf04..9f672ab 100644 --- a/circuitpython_uplot/ucartesian.py +++ b/circuitpython_uplot/cartesian.py @@ -4,7 +4,7 @@ """ -`ucartesian` +`cartesian` ================================================================================ CircuitPython cartesian graph @@ -15,7 +15,7 @@ """ try: from typing import Optional, Union - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Uplot except ImportError: pass from bitmaptools import draw_line, fill_region @@ -26,7 +26,7 @@ __repo__ = "https://github.com/adafruit/CircuitPython_uplot.git" -class ucartesian: +class Cartesian: """ Class to draw cartesian plane """ diff --git a/circuitpython_uplot/fillbetween.py b/circuitpython_uplot/fillbetween.py index 094711f..195af92 100644 --- a/circuitpython_uplot/fillbetween.py +++ b/circuitpython_uplot/fillbetween.py @@ -15,7 +15,7 @@ """ try: from typing import Optional, Union - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Uplot except ImportError: pass from ulab import numpy as np diff --git a/circuitpython_uplot/logging.py b/circuitpython_uplot/logging.py index 9037812..c0c38b1 100644 --- a/circuitpython_uplot/logging.py +++ b/circuitpython_uplot/logging.py @@ -15,7 +15,7 @@ """ try: from typing import Union - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Uplot except ImportError: pass from bitmaptools import draw_line, fill_region diff --git a/circuitpython_uplot/map.py b/circuitpython_uplot/map.py index e8526e1..fddb493 100644 --- a/circuitpython_uplot/map.py +++ b/circuitpython_uplot/map.py @@ -15,7 +15,7 @@ """ try: - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Uplot except ImportError: pass diff --git a/circuitpython_uplot/pie.py b/circuitpython_uplot/pie.py index 85e5653..d5461e0 100644 --- a/circuitpython_uplot/pie.py +++ b/circuitpython_uplot/pie.py @@ -14,7 +14,7 @@ """ try: - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Uplot except ImportError: pass diff --git a/circuitpython_uplot/uplot.py b/circuitpython_uplot/plot.py similarity index 99% rename from circuitpython_uplot/uplot.py rename to circuitpython_uplot/plot.py index 20e1eb4..1ef9705 100644 --- a/circuitpython_uplot/uplot.py +++ b/circuitpython_uplot/plot.py @@ -4,7 +4,7 @@ """ -`uplot` +`plot` ================================================================================ CircuitPython Plot Class @@ -41,7 +41,7 @@ __repo__ = "https://github.com/jposada202020/CircuitPython_uplot.git" -class Uplot(displayio.Group): +class Plot(displayio.Group): """ Canvas Class to add different elements to the screen. The origin point set by ``x`` and ``y`` properties diff --git a/circuitpython_uplot/polar.py b/circuitpython_uplot/polar.py index ec90947..e161985 100644 --- a/circuitpython_uplot/polar.py +++ b/circuitpython_uplot/polar.py @@ -15,7 +15,7 @@ """ try: from typing import Optional, Union - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Uplot except ImportError: pass from bitmaptools import draw_line, draw_circle diff --git a/circuitpython_uplot/scatter.py b/circuitpython_uplot/scatter.py index 944c513..1f55a5f 100644 --- a/circuitpython_uplot/scatter.py +++ b/circuitpython_uplot/scatter.py @@ -16,7 +16,7 @@ """ try: from typing import Optional, Union - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Uplot except ImportError: pass diff --git a/circuitpython_uplot/shade.py b/circuitpython_uplot/shade.py index 5034198..f6953f3 100644 --- a/circuitpython_uplot/shade.py +++ b/circuitpython_uplot/shade.py @@ -15,7 +15,7 @@ """ try: from typing import Optional, Union - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Uplot except ImportError: pass from ulab import numpy as np diff --git a/circuitpython_uplot/svg.py b/circuitpython_uplot/svg.py index 9293ba4..6abaf6d 100644 --- a/circuitpython_uplot/svg.py +++ b/circuitpython_uplot/svg.py @@ -14,7 +14,7 @@ """ try: - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Uplot except ImportError: pass from bitmaptools import draw_line diff --git a/docs/api.rst b/docs/api.rst index 3bb2cfc..1e052b5 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -13,7 +13,7 @@ Uplot Library .. automodule:: circuitpython_uplot.pie :members: -.. automodule:: circuitpython_uplot.ucartesian +.. automodule:: circuitpython_uplot.cartesian :members: .. automodule:: circuitpython_uplot.fillbetween diff --git a/docs/examples.rst b/docs/examples.rst index c1ac8ef..1554c70 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -137,18 +137,18 @@ Cartesian Advanced Example Showing the ability to display to graphs in the same plot with different colors -.. literalinclude:: ../examples/uplot_ucartesian_advanced.py - :caption: examples/uplot_ucartesian_advanced.py +.. literalinclude:: ../examples/uplot_cartesian_advanced.py + :caption: examples/uplot_cartesian_advanced.py :lines: 5- -.. image:: ../docs/uplot_ex11.jpg +.. image:: ../docs/uplot_cartesian_advance.jpg Cartesian Table Example --------------------------- Example showing how to add a data table to the plot -.. literalinclude:: ../examples/uplot_ucartesian_table.py - :caption: examples/uplot_ucartesian_table.py +.. literalinclude:: ../examples/uplot_cartesian_table.py + :caption: examples/uplot_cartesian_table.py :lines: 5- Lissajous Curves Example @@ -235,8 +235,8 @@ Cartesian Animation Example Cartesian animation example -.. literalinclude:: ../examples/uplot_ucartesian_loggin_data.py - :caption: examples/uplot_ucartesian_loggin_data.py +.. literalinclude:: ../examples/uplot_cartesian_loggin_data.py + :caption: examples/uplot_cartesian_loggin_data.py :lines: 5- .. image:: ../docs/uplot_cartesian.gif diff --git a/docs/quick_start.rst b/docs/quick_start.rst index b41cc8b..a16c8de 100644 --- a/docs/quick_start.rst +++ b/docs/quick_start.rst @@ -172,7 +172,7 @@ to the `ulab` library from ulab import numpy as np from circuitpython_uplot.uplot import Uplot - from circuitpython_uplot.ucartesian import ucartesian + from circuitpython_uplot.cartesian import Cartesian display = board.DISPLAY plot = Uplot(0, 0, display.width, display.height) @@ -184,7 +184,7 @@ After the initial setup we add our xy plane and show our plot .. code-block:: python - ucartesian(plot, x, y) + Cartesian(plot, x, y) display.show(plot) @@ -203,7 +203,7 @@ the y axis to [0, 1], line color to Green :const:`0x00FF00` and no filling x = np.linspace(-3, 3, num=50) constant = 2.0 / np.sqrt(2 * np.pi) y = constant * np.exp((-(x**2)) / 2.0) - ucartesian(plot, x, y, rangex=[-5, 5], rangey=[0, 1], line_color=0x00FF00) + Cartesian(plot, x, y, rangex=[-5, 5], rangey=[0, 1], line_color=0x00FF00) if you want to add more than un line to your plot, you could do something like this: @@ -214,8 +214,8 @@ if you want to add more than un line to your plot, you could do something like t x = np.linspace(-4, 4, num=25) y1 = x**2 / 2 y2 = 2 + x**2 + 3 * x - ucartesian(plot, x, y1) - ucartesian(plot, x, y1) + Cartesian(plot, x, y1) + Cartesian(plot, x, y1) display.show(plot) diff --git a/docs/uplot_ex11.jpg b/docs/uplot_cartesian_advance.jpg similarity index 100% rename from docs/uplot_ex11.jpg rename to docs/uplot_cartesian_advance.jpg diff --git a/examples/uplot_bar_3Dbars.py b/examples/uplot_bar_3Dbars.py index a2c626c..4b5aa75 100644 --- a/examples/uplot_bar_3Dbars.py +++ b/examples/uplot_bar_3Dbars.py @@ -4,7 +4,7 @@ import time import board -from circuitpython_uplot.uplot import Uplot +from circuitpython_uplot.plot import Uplot from circuitpython_uplot.bar import Bar diff --git a/examples/uplot_bar_color_changing.py b/examples/uplot_bar_color_changing.py index 0eb03cc..3223432 100644 --- a/examples/uplot_bar_color_changing.py +++ b/examples/uplot_bar_color_changing.py @@ -4,7 +4,7 @@ import time import board -from circuitpython_uplot.uplot import Uplot, color +from circuitpython_uplot.plot import Uplot, color from circuitpython_uplot.bar import Bar # Setting up the display diff --git a/examples/uplot_bar_colorpalette.py b/examples/uplot_bar_colorpalette.py index cabe811..98056f6 100644 --- a/examples/uplot_bar_colorpalette.py +++ b/examples/uplot_bar_colorpalette.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: MIT import board -from circuitpython_uplot.uplot import Uplot, color +from circuitpython_uplot.plot import Uplot, color from circuitpython_uplot.bar import Bar # Setting up the display diff --git a/examples/uplot_bar_example.py b/examples/uplot_bar_example.py index 3c8b5bc..49e3cd6 100644 --- a/examples/uplot_bar_example.py +++ b/examples/uplot_bar_example.py @@ -4,7 +4,7 @@ import time import board -from circuitpython_uplot.uplot import Uplot +from circuitpython_uplot.plot import Uplot from circuitpython_uplot.bar import Bar diff --git a/examples/uplot_bar_scale_example.py b/examples/uplot_bar_scale_example.py index 635d1ed..4cf9c45 100644 --- a/examples/uplot_bar_scale_example.py +++ b/examples/uplot_bar_scale_example.py @@ -5,7 +5,7 @@ import time import board import displayio -from circuitpython_uplot.uplot import Uplot +from circuitpython_uplot.plot import Uplot from circuitpython_uplot.bar import Bar # from uplot_examples import u8 diff --git a/examples/uplot_bar_updating_values.py b/examples/uplot_bar_updating_values.py index 63684d1..7b69fbd 100644 --- a/examples/uplot_bar_updating_values.py +++ b/examples/uplot_bar_updating_values.py @@ -4,7 +4,7 @@ import time import board -from circuitpython_uplot.uplot import Uplot, color +from circuitpython_uplot.plot import Uplot, color from circuitpython_uplot.bar import Bar # Setting up the display diff --git a/examples/uplot_ucartesian_advanced.py b/examples/uplot_cartesian_advanced.py similarity index 72% rename from examples/uplot_ucartesian_advanced.py rename to examples/uplot_cartesian_advanced.py index 69d26dc..9a1c2bc 100644 --- a/examples/uplot_ucartesian_advanced.py +++ b/examples/uplot_cartesian_advanced.py @@ -5,8 +5,8 @@ import time import board from ulab import numpy as np -from circuitpython_uplot.uplot import Uplot -from circuitpython_uplot.ucartesian import ucartesian +from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.cartesian import Cartesian # Setting up the display display = board.DISPLAY @@ -18,13 +18,13 @@ y = constant * np.exp((-(x**2)) / 2.0) # Drawing the graph -ucartesian(plot, x, y, rangex=[-5, 5], rangey=[0, 1], line_color=0xFF0000) +Cartesian(plot, x, y, rangex=[-5, 5], rangey=[0, 1], line_color=0xFF0000) # Creating some points to graph x = np.linspace(-3, 3, num=50) constant = 2.0 / np.sqrt(2 * np.pi) y = constant * np.exp((-(x**2)) / 2.0) -ucartesian(plot, x, y, rangex=[-5, 5], rangey=[0, 1], line_color=0x00FF00) +Cartesian(plot, x, y, rangex=[-5, 5], rangey=[0, 1], line_color=0x00FF00) # Plotting and showing the plot display.show(plot) diff --git a/examples/uplot_ucartesian_loggin_data.py b/examples/uplot_cartesian_loggin_data.py similarity index 94% rename from examples/uplot_ucartesian_loggin_data.py rename to examples/uplot_cartesian_loggin_data.py index dbe890a..c7ddd79 100644 --- a/examples/uplot_ucartesian_loggin_data.py +++ b/examples/uplot_cartesian_loggin_data.py @@ -8,8 +8,8 @@ import terminalio import board from adafruit_display_text import label -from circuitpython_uplot.uplot import Uplot, color -from circuitpython_uplot.ucartesian import ucartesian +from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.cartesian import Cartesian # Setting up the display display = board.DISPLAY @@ -83,7 +83,7 @@ display.refresh() for i, element in enumerate(x): - ucartesian( + Cartesian( plot_1, x[0:i], temp_y[0:i], @@ -93,7 +93,7 @@ line_color=color.BLACK, logging=True, ) - ucartesian( + Cartesian( plot_2, x[0:i], humidity_y[0:i], diff --git a/examples/uplot_ucartesian_table.py b/examples/uplot_cartesian_table.py similarity index 92% rename from examples/uplot_ucartesian_table.py rename to examples/uplot_cartesian_table.py index f7850a6..cf042fb 100644 --- a/examples/uplot_ucartesian_table.py +++ b/examples/uplot_cartesian_table.py @@ -6,8 +6,8 @@ import board from ulab import numpy as np from table import Table -from circuitpython_uplot.uplot import Uplot, color -from circuitpython_uplot.ucartesian import ucartesian +from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.cartesian import Cartesian from circuitpython_uplot.shade import shade @@ -101,7 +101,7 @@ def heat_index(temp, humidity): # Drawing the graphs for i in range(40, 110, 10): - ucartesian(plot, x, heat_index(x, i), rangex=[25, 50], rangey=[25, 60]) + Cartesian(plot, x, heat_index(x, i), rangex=[25, 50], rangey=[25, 60]) g.append(plot) diff --git a/examples/uplot_display_shapes.py b/examples/uplot_display_shapes.py index bb215c1..0994a2f 100644 --- a/examples/uplot_display_shapes.py +++ b/examples/uplot_display_shapes.py @@ -6,7 +6,7 @@ import board from adafruit_display_shapes.polygon import Polygon from adafruit_display_shapes.roundrect import RoundRect -from circuitpython_uplot.uplot import Uplot +from circuitpython_uplot.plot import Uplot # Setting up the display display = board.DISPLAY diff --git a/examples/uplot_fillbetween.py b/examples/uplot_fillbetween.py index 340e6e9..c530f02 100644 --- a/examples/uplot_fillbetween.py +++ b/examples/uplot_fillbetween.py @@ -5,7 +5,7 @@ import time import board from ulab import numpy as np -from circuitpython_uplot.uplot import Uplot +from circuitpython_uplot.plot import Uplot from circuitpython_uplot.fillbetween import Fillbetween diff --git a/examples/uplot_integration_example.py b/examples/uplot_integration_example.py index 2252395..3ee22b1 100644 --- a/examples/uplot_integration_example.py +++ b/examples/uplot_integration_example.py @@ -5,8 +5,8 @@ import board from ulab import numpy as np from uhistogram import Histogram -from circuitpython_uplot.uplot import Uplot -from circuitpython_uplot.ucartesian import ucartesian +from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.cartesian import Cartesian # Setting Up the histogram data = [5, 4, 3, 2, 7, 5, 3, 3, 3, 3, 2, 9, 7, 6] @@ -25,7 +25,7 @@ y = constant * np.exp((-(x**2)) / 2.0) # Plotting and showing the plot -ucartesian(plot, x, y) +Cartesian(plot, x, y) # Adding a circle plot.draw_circle(radius=8, x=120, y=120) diff --git a/examples/uplot_lissajous_curves.py b/examples/uplot_lissajous_curves.py index bbdf3c7..34ddbc7 100644 --- a/examples/uplot_lissajous_curves.py +++ b/examples/uplot_lissajous_curves.py @@ -5,8 +5,8 @@ import math import board import displayio -from circuitpython_uplot.uplot import Uplot, color -from circuitpython_uplot.ucartesian import ucartesian +from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.cartesian import Cartesian # Inspired by Paul McWhorter Raspberry Pi Pico W LESSON 27: Creating Lissajous Patterns # on an OLED Display @@ -57,7 +57,7 @@ def create_curve(a=1, b=2, mul_factor=10, delta=3.14 / 2): # Creating the Plots x_number_list, y_number_list = create_curve(1, 2, 10) -ucartesian( +Cartesian( plot, x_number_list, y_number_list, @@ -67,7 +67,7 @@ def create_curve(a=1, b=2, mul_factor=10, delta=3.14 / 2): ) x_number_list, y_number_list = create_curve(3, 2, 10) -ucartesian( +Cartesian( plot2, x_number_list, y_number_list, @@ -77,7 +77,7 @@ def create_curve(a=1, b=2, mul_factor=10, delta=3.14 / 2): ) x_number_list, y_number_list = create_curve(3, 4, 10) -ucartesian( +Cartesian( plot3, x_number_list, y_number_list, @@ -87,7 +87,7 @@ def create_curve(a=1, b=2, mul_factor=10, delta=3.14 / 2): ) x_number_list, y_number_list = create_curve(5, 4, 10) -ucartesian( +Cartesian( plot4, x_number_list, y_number_list, diff --git a/examples/uplot_logging.py b/examples/uplot_logging.py index 404cb25..deebad6 100644 --- a/examples/uplot_logging.py +++ b/examples/uplot_logging.py @@ -6,7 +6,7 @@ import terminalio import board from adafruit_display_text import label -from circuitpython_uplot.uplot import Uplot, color +from circuitpython_uplot.plot import Uplot, color from circuitpython_uplot.logging import Logging # Setting up the display diff --git a/examples/uplot_logging_animation.py b/examples/uplot_logging_animation.py index f824bd6..7296201 100644 --- a/examples/uplot_logging_animation.py +++ b/examples/uplot_logging_animation.py @@ -6,7 +6,7 @@ import time import random import board -from circuitpython_uplot.uplot import Uplot, color +from circuitpython_uplot.plot import Uplot, color from circuitpython_uplot.logging import Logging # Setting up the display diff --git a/examples/uplot_logging_changing_values.py b/examples/uplot_logging_changing_values.py index 37782cc..cc1f277 100644 --- a/examples/uplot_logging_changing_values.py +++ b/examples/uplot_logging_changing_values.py @@ -5,7 +5,7 @@ import time import displayio import board -from circuitpython_uplot.uplot import Uplot, color +from circuitpython_uplot.plot import Uplot, color from circuitpython_uplot.logging import Logging # Setting up the display diff --git a/examples/uplot_logging_fill.py b/examples/uplot_logging_fill.py index ee22c09..15be1c9 100644 --- a/examples/uplot_logging_fill.py +++ b/examples/uplot_logging_fill.py @@ -4,7 +4,7 @@ import displayio import board -from circuitpython_uplot.uplot import Uplot, color +from circuitpython_uplot.plot import Uplot, color from circuitpython_uplot.logging import Logging # Setting up the display diff --git a/examples/uplot_logging_table.py b/examples/uplot_logging_table.py index c1e5c15..d8d399a 100644 --- a/examples/uplot_logging_table.py +++ b/examples/uplot_logging_table.py @@ -11,7 +11,7 @@ import displayio import board from table import Table -from circuitpython_uplot.uplot import Uplot, color +from circuitpython_uplot.plot import Uplot, color from circuitpython_uplot.logging import Logging # Create a display object diff --git a/examples/uplot_map.py b/examples/uplot_map.py index 088feba..462a934 100644 --- a/examples/uplot_map.py +++ b/examples/uplot_map.py @@ -6,7 +6,7 @@ from random import choice import board from ulab import numpy as np -from circuitpython_uplot.uplot import Uplot +from circuitpython_uplot.plot import Uplot from circuitpython_uplot.map import Map diff --git a/examples/uplot_pie_example.py b/examples/uplot_pie_example.py index 0b92747..6ea238f 100644 --- a/examples/uplot_pie_example.py +++ b/examples/uplot_pie_example.py @@ -4,7 +4,7 @@ import time import board -from circuitpython_uplot.uplot import Uplot +from circuitpython_uplot.plot import Uplot from circuitpython_uplot.pie import upie diff --git a/examples/uplot_plot_example.py b/examples/uplot_plot_example.py index 2c64ac8..afa844d 100644 --- a/examples/uplot_plot_example.py +++ b/examples/uplot_plot_example.py @@ -5,8 +5,8 @@ import time import board from ulab import numpy as np -from circuitpython_uplot.uplot import Uplot -from circuitpython_uplot.ucartesian import ucartesian +from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.cartesian import Cartesian # Setting up the display display = board.DISPLAY @@ -20,7 +20,7 @@ y = constant * np.exp((-(x**2)) / 2.0) # Drawing the graph -ucartesian(plot, x, y) +Cartesian(plot, x, y) display.show(plot) while True: diff --git a/examples/uplot_polar_example.py b/examples/uplot_polar_example.py index d3932ec..9a2865b 100644 --- a/examples/uplot_polar_example.py +++ b/examples/uplot_polar_example.py @@ -4,7 +4,7 @@ import board import ulab.numpy as np -from circuitpython_uplot.uplot import Uplot, color +from circuitpython_uplot.plot import Uplot, color from circuitpython_uplot.polar import Polar # Setting up the display diff --git a/examples/uplot_polar_plots.py b/examples/uplot_polar_plots.py index d9e8b3b..24665ad 100644 --- a/examples/uplot_polar_plots.py +++ b/examples/uplot_polar_plots.py @@ -5,8 +5,8 @@ import board import displayio import ulab.numpy as np -from circuitpython_uplot.uplot import Uplot, color -from circuitpython_uplot.ucartesian import ucartesian +from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.cartesian import Cartesian # Inspired by # https://github.com/CodeDrome/polar-plots-python @@ -86,13 +86,13 @@ def circle_function(angle_range=[0, 360], radius=35): x, y = rose_function(n=3, angle_range=[0, 360], radius=35) -ucartesian(plot, x, y, rangex=[-40, 40], rangey=[-40, 40], line_color=0xE30B5D) +Cartesian(plot, x, y, rangex=[-40, 40], rangey=[-40, 40], line_color=0xE30B5D) x, y = spiral_function(a=1, b=3, angle_range=[0, 900]) -ucartesian(plot2, x, y, rangex=[-50, 50], rangey=[-50, 50], line_color=color.YELLOW) +Cartesian(plot2, x, y, rangex=[-50, 50], rangey=[-50, 50], line_color=color.YELLOW) x, y = cardioid_function(angle_range=[0, 360], radius=35) -ucartesian(plot3, x, y, rangex=[-15, 75], rangey=[-50, 50], line_color=color.TEAL) +Cartesian(plot3, x, y, rangex=[-15, 75], rangey=[-50, 50], line_color=color.TEAL) x, y = circle_function(angle_range=[0, 360], radius=35) -ucartesian(plot4, x, y, rangex=[-40, 40], rangey=[-40, 40], line_color=color.ORANGE) +Cartesian(plot4, x, y, rangex=[-40, 40], rangey=[-40, 40], line_color=color.ORANGE) diff --git a/examples/uplot_readme_example.py b/examples/uplot_readme_example.py index 2dd23bc..8b6efa4 100644 --- a/examples/uplot_readme_example.py +++ b/examples/uplot_readme_example.py @@ -6,11 +6,11 @@ import board import displayio from ulab import numpy as np -from circuitpython_uplot.uplot import Uplot +from circuitpython_uplot.plot import Uplot from circuitpython_uplot.bar import Bar from circuitpython_uplot.scatter import Scatter from circuitpython_uplot.pie import Pie -from circuitpython_uplot.ucartesian import ucartesian +from circuitpython_uplot.cartesian import Cartesian display = board.DISPLAY @@ -26,7 +26,7 @@ x = np.linspace(-4, 4, num=25) constant = 2.0 / np.sqrt(2 * np.pi) y = constant * np.exp((-(x**2)) / 4.0) -ucartesian(plot2, x, y, rangex=[-5, 5], rangey=[0, 1]) +Cartesian(plot2, x, y, rangex=[-5, 5], rangey=[0, 1]) plot.append(plot2) plot3 = Uplot(130, 0, 160, 160) @@ -40,7 +40,7 @@ y = constant * np.exp((-(x**2)) / 2.0) # Plotting and showing the plot -ucartesian(plot3, x, y, rangex=[-5, 5], rangey=[0, 0.5]) +Cartesian(plot3, x, y, rangex=[-5, 5], rangey=[0, 0.5]) plot.append(plot3) plot4 = Uplot(290, 0, 150, 150) @@ -80,13 +80,13 @@ x = np.linspace(1, 10, num=10) y = [6, 7, 9, 6, 9, 7, 6, 6, 8, 9] -ucartesian(plot7, x, y, rangex=[0, 11], rangey=[0, 12], line_color=0xFF0000, fill=True) +Cartesian(plot7, x, y, rangex=[0, 11], rangey=[0, 12], line_color=0xFF0000, fill=True) y = [4, 3, 7, 8, 3, 9, 3, 2, 1, 2] -ucartesian(plot7, x, y, rangex=[0, 11], rangey=[0, 12], line_color=0xFF00FF, fill=True) +Cartesian(plot7, x, y, rangex=[0, 11], rangey=[0, 12], line_color=0xFF00FF, fill=True) y = [1, 4, 6, 3, 6, 6, 5, 0, 9, 2] -ucartesian(plot7, x, y, rangex=[0, 11], rangey=[0, 12], line_color=0x4444FF, fill=True) +Cartesian(plot7, x, y, rangex=[0, 11], rangey=[0, 12], line_color=0x4444FF, fill=True) plot.append(plot7) diff --git a/examples/uplot_scatter.py b/examples/uplot_scatter.py index 9994bd0..8782450 100644 --- a/examples/uplot_scatter.py +++ b/examples/uplot_scatter.py @@ -6,7 +6,7 @@ from random import choice import board from ulab import numpy as np -from circuitpython_uplot.uplot import Uplot +from circuitpython_uplot.plot import Uplot from circuitpython_uplot.scatter import Scatter diff --git a/examples/uplot_shade_example.py b/examples/uplot_shade_example.py index e6ec3e6..f3bf477 100644 --- a/examples/uplot_shade_example.py +++ b/examples/uplot_shade_example.py @@ -5,8 +5,8 @@ import time import board from ulab import numpy as np -from circuitpython_uplot.uplot import Uplot -from circuitpython_uplot.ucartesian import ucartesian +from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.cartesian import Cartesian from circuitpython_uplot.shade import shade # This example is based in the following Library @@ -97,7 +97,7 @@ def heat_index(temp, humidity): # Drawing the graphs for i in range(40, 110, 10): - ucartesian(plot, x, heat_index(x, i), rangex=[25, 50], rangey=[25, 60]) + Cartesian(plot, x, heat_index(x, i), rangex=[25, 50], rangey=[25, 60]) display.show(plot) while True: diff --git a/examples/uplot_simpletest.py b/examples/uplot_simpletest.py index 80a2726..0063af9 100644 --- a/examples/uplot_simpletest.py +++ b/examples/uplot_simpletest.py @@ -4,7 +4,7 @@ import time import board -from circuitpython_uplot.uplot import Uplot +from circuitpython_uplot.plot import Uplot # Setting up the display display = board.DISPLAY diff --git a/examples/uplot_sparkline.py b/examples/uplot_sparkline.py index 2fd105e..b5366f7 100644 --- a/examples/uplot_sparkline.py +++ b/examples/uplot_sparkline.py @@ -6,7 +6,7 @@ import board from ulab import numpy as np from adafruit_display_shapes.sparkline import Sparkline -from circuitpython_uplot.uplot import Uplot, color +from circuitpython_uplot.plot import Uplot, color # Setting up the display diff --git a/examples/uplot_stackplot.py b/examples/uplot_stackplot.py index 4e03bb6..6239758 100644 --- a/examples/uplot_stackplot.py +++ b/examples/uplot_stackplot.py @@ -8,8 +8,8 @@ import time import board from ulab import numpy as np -from circuitpython_uplot.uplot import Uplot -from circuitpython_uplot.ucartesian import ucartesian +from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.cartesian import Cartesian # Setting up the display display = board.DISPLAY @@ -19,13 +19,13 @@ x = np.linspace(1, 10, num=10) y = [6, 7, 9, 6, 9, 7, 6, 6, 8, 9] -ucartesian(plot, x, y, rangex=[0, 11], rangey=[0, 12], line_color=0xFF0000, fill=True) +Cartesian(plot, x, y, rangex=[0, 11], rangey=[0, 12], line_color=0xFF0000, fill=True) y = [4, 3, 7, 8, 3, 9, 3, 2, 1, 2] -ucartesian(plot, x, y, rangex=[0, 11], rangey=[0, 12], line_color=0xFF00FF, fill=True) +Cartesian(plot, x, y, rangex=[0, 11], rangey=[0, 12], line_color=0xFF00FF, fill=True) y = [1, 4, 6, 3, 6, 6, 5, 0, 9, 2] -ucartesian(plot, x, y, rangex=[0, 11], rangey=[0, 12], line_color=0x4444FF, fill=True) +Cartesian(plot, x, y, rangex=[0, 11], rangey=[0, 12], line_color=0x4444FF, fill=True) display.show(plot) diff --git a/examples/uplot_svg_example.py b/examples/uplot_svg_example.py index 65c7d4e..7aba1d1 100644 --- a/examples/uplot_svg_example.py +++ b/examples/uplot_svg_example.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: MIT import board -from circuitpython_uplot.uplot import Uplot, color +from circuitpython_uplot.plot import Uplot, color from circuitpython_uplot.svg import SVG from circuitpython_uplot.icons import FULL, Humidity, Temperature, Temperature2 diff --git a/examples/uplot_tickparameters.py b/examples/uplot_tickparameters.py index 0d99895..a77d414 100644 --- a/examples/uplot_tickparameters.py +++ b/examples/uplot_tickparameters.py @@ -5,8 +5,8 @@ import time import board from ulab import numpy as np -from circuitpython_uplot.uplot import Uplot, color -from circuitpython_uplot.ucartesian import ucartesian +from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.cartesian import Cartesian # Setting up the display @@ -30,7 +30,7 @@ y = constant * np.exp((-(x**2)) / 2.0) # Drawing the graph -ucartesian(plot, x, y, line_color=color.BLACK) +Cartesian(plot, x, y, line_color=color.BLACK) # Plotting and showing the plot display.show(plot) diff --git a/examples/uplot_uboxplot.py b/examples/uplot_uboxplot.py index 7f6ae46..eb245bd 100644 --- a/examples/uplot_uboxplot.py +++ b/examples/uplot_uboxplot.py @@ -7,7 +7,7 @@ import board from uboxplot import Boxplot -from circuitpython_uplot.uplot import Uplot +from circuitpython_uplot.plot import Uplot display = board.DISPLAY