From a39ec1e4980fd6d500d7859eb2e0a5940d6668a2 Mon Sep 17 00:00:00 2001 From: jposada202020 Date: Fri, 28 Jul 2023 15:02:05 -0400 Subject: [PATCH] plot name change --- circuitpython_uplot/cartesian.py | 6 +- circuitpython_uplot/fillbetween.py | 6 +- circuitpython_uplot/logging.py | 14 ++--- circuitpython_uplot/map.py | 6 +- circuitpython_uplot/pie.py | 6 +- circuitpython_uplot/polar.py | 6 +- circuitpython_uplot/scatter.py | 4 +- circuitpython_uplot/shade.py | 6 +- circuitpython_uplot/svg.py | 6 +- docs/api.rst | 2 +- docs/quick_start.rst | 68 +++++++++++------------ examples/uplot_bar_3Dbars.py | 4 +- examples/uplot_bar_color_changing.py | 4 +- examples/uplot_bar_colorpalette.py | 4 +- examples/uplot_bar_example.py | 4 +- examples/uplot_bar_scale_example.py | 7 +-- examples/uplot_bar_updating_values.py | 4 +- examples/uplot_cartesian_advanced.py | 4 +- examples/uplot_cartesian_loggin_data.py | 8 +-- examples/uplot_cartesian_table.py | 4 +- examples/uplot_display_shapes.py | 4 +- examples/uplot_fillbetween.py | 4 +- examples/uplot_integration_example.py | 4 +- examples/uplot_lissajous_curves.py | 10 ++-- examples/uplot_logging.py | 6 +- examples/uplot_logging_animation.py | 4 +- examples/uplot_logging_changing_values.py | 6 +- examples/uplot_logging_fill.py | 6 +- examples/uplot_logging_table.py | 4 +- examples/uplot_map.py | 4 +- examples/uplot_pie_example.py | 4 +- examples/uplot_plot_example.py | 4 +- examples/uplot_polar_example.py | 4 +- examples/uplot_polar_plots.py | 10 ++-- examples/uplot_readme_example.py | 16 +++--- examples/uplot_scatter.py | 4 +- examples/uplot_shade_example.py | 4 +- examples/uplot_simpletest.py | 4 +- examples/uplot_sparkline.py | 4 +- examples/uplot_stackplot.py | 4 +- examples/uplot_svg_example.py | 4 +- examples/uplot_tickparameters.py | 4 +- examples/uplot_uboxplot.py | 6 +- 43 files changed, 148 insertions(+), 149 deletions(-) diff --git a/circuitpython_uplot/cartesian.py b/circuitpython_uplot/cartesian.py index 9f672ab..6ec7c33 100644 --- a/circuitpython_uplot/cartesian.py +++ b/circuitpython_uplot/cartesian.py @@ -15,7 +15,7 @@ """ try: from typing import Optional, Union - from circuitpython_uplot.plot import Uplot + from circuitpython_uplot.plot import Plot except ImportError: pass from bitmaptools import draw_line, fill_region @@ -33,7 +33,7 @@ class Cartesian: def __init__( self, - plot: Uplot, + plot: Plot, x: Union[list, np.linspace, np.ndarray], y: Union[list, np.linspace, np.ndarray], rangex: Optional[list] = None, @@ -45,7 +45,7 @@ def __init__( ) -> 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|ulab.numpy.linspace|ulab.numpy.ndarray x: x points coordinates :param list|ulab.numpy.linspace|ulab.numpy.ndarray y: y points coordinates :param list|None rangex: x range limits. Defaults to None diff --git a/circuitpython_uplot/fillbetween.py b/circuitpython_uplot/fillbetween.py index 195af92..d2f170a 100644 --- a/circuitpython_uplot/fillbetween.py +++ b/circuitpython_uplot/fillbetween.py @@ -15,7 +15,7 @@ """ try: from typing import Optional, Union - from circuitpython_uplot.plot import Uplot + from circuitpython_uplot.plot import Plot except ImportError: pass from ulab import numpy as np @@ -33,7 +33,7 @@ class Fillbetween: def __init__( self, - plot: Uplot, + plot: Plot, x: Union[list, np.linspace, np.ndarray], y1: Union[list, np.linspace, np.ndarray], y2: Union[list, np.linspace, np.ndarray], @@ -43,7 +43,7 @@ def __init__( nudge: bool = True, ) -> 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|ulab.numpy.linspace|ulab.numpy.ndarray x: x points coordinates :param list|ulab.numpy.linspace|ulab.numpy.ndarray y1: y1 points coordinates :param list|ulab.numpy.linspace|ulab.numpy.ndarray y2: y2 points coordinates diff --git a/circuitpython_uplot/logging.py b/circuitpython_uplot/logging.py index c0c38b1..6cc081e 100644 --- a/circuitpython_uplot/logging.py +++ b/circuitpython_uplot/logging.py @@ -15,7 +15,7 @@ """ try: from typing import Union - from circuitpython_uplot.plot import Uplot + from circuitpython_uplot.plot import Plot except ImportError: pass from bitmaptools import draw_line, fill_region @@ -32,7 +32,7 @@ class Logging: def __init__( self, - plot: Uplot, + plot: Plot, x: Union[list, np.linspace, np.ndarray], y: Union[list, np.linspace, np.ndarray], rangex: list, @@ -45,7 +45,7 @@ def __init__( ) -> None: """ - :param Uplot plot: Plot object for the log to be drawn + :param Plot plot: Plot object for the log to be drawn :param list|ulab.numpy.linspace|ulab.numpy.ndarray x: x points coordinates :param list|ulab.numpy.linspace|ulab.numpy.ndarray y: y points coordinates :param list|None rangex: x range limits. Defaults to None @@ -140,10 +140,10 @@ def clear_plot(plot) -> None: 0, ) - def draw_points(self, plot: Uplot, x: list, y: list, fill: bool = False) -> None: + def draw_points(self, plot: Plot, x: list, y: list, fill: bool = False) -> None: """ Draws points in the plot - :param Uplot plot: plot object provided + :param Plot plot: plot object provided :param list x: list of x values :param list y: list of y values :param bool fill: parameter to fill the plot graphic. Defaults to False @@ -153,10 +153,10 @@ def draw_points(self, plot: Uplot, x: list, y: list, fill: bool = False) -> None self.draw_new_lines(plot, x, y, fill) - def draw_new_lines(self, plot: Uplot, x: list, y: list, fill: bool = False) -> None: + def draw_new_lines(self, plot: Plot, x: list, y: list, fill: bool = False) -> None: """ Draw the plot lines - :param Uplot plot: plot object provided + :param Plot plot: plot object provided :param list x: list of x values :param list y: list of y values :param bool fill: parameter to fill the plot graphic. Defaults to False diff --git a/circuitpython_uplot/map.py b/circuitpython_uplot/map.py index fddb493..fb9f286 100644 --- a/circuitpython_uplot/map.py +++ b/circuitpython_uplot/map.py @@ -15,7 +15,7 @@ """ try: - from circuitpython_uplot.plot import Uplot + from circuitpython_uplot.plot import Plot except ImportError: pass @@ -34,14 +34,14 @@ class Map: def __init__( self, - plot: Uplot, + plot: Plot, data_points: np.ndarray, initial_color: int, final_color: int, ) -> None: """ - :param Uplot plot: Plot object for the scatter to be drawn + :param Plot plot: Plot object for the scatter to be drawn :param np.array data_points: data points to create the color map :param int initial_color: initial color to create the color map :param int final_color: final color to create the color map diff --git a/circuitpython_uplot/pie.py b/circuitpython_uplot/pie.py index d5461e0..02bcb8a 100644 --- a/circuitpython_uplot/pie.py +++ b/circuitpython_uplot/pie.py @@ -14,7 +14,7 @@ """ try: - from circuitpython_uplot.plot import Uplot + from circuitpython_uplot.plot import Plot except ImportError: pass @@ -32,11 +32,11 @@ class Pie: """ def __init__( - self, plot: Uplot, data: list, x: int = 0, y: int = 0, radius: int = 40 + self, plot: Plot, data: list, x: int = 0, y: int = 0, radius: int = 40 ) -> None: """ - :param Uplot plot: Plot object for the pie to be drawn + :param Plot plot: Plot object for the pie to be drawn :param list data: data to make the pie :param int x: pie center x coordinate :param int y: pie center y coordinate diff --git a/circuitpython_uplot/polar.py b/circuitpython_uplot/polar.py index e161985..c4ab576 100644 --- a/circuitpython_uplot/polar.py +++ b/circuitpython_uplot/polar.py @@ -15,7 +15,7 @@ """ try: from typing import Optional, Union - from circuitpython_uplot.plot import Uplot + from circuitpython_uplot.plot import Plot except ImportError: pass from bitmaptools import draw_line, draw_circle @@ -33,7 +33,7 @@ class Polar: def __init__( self, - plot: Uplot, + plot: Plot, radius: Union[list, np.linspace, np.ndarray], theta: Union[list, np.linspace, np.ndarray], rangex: Optional[list] = None, @@ -45,7 +45,7 @@ def __init__( ) -> 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|ulab.numpy.linspace|ulab.numpy.ndarray radius: radius points :param list|ulab.numpy.linspace|ulab.numpy.ndarray theta: theta points :param list|None rangex: x range limits. Defaults to None diff --git a/circuitpython_uplot/scatter.py b/circuitpython_uplot/scatter.py index 1f55a5f..d8e21df 100644 --- a/circuitpython_uplot/scatter.py +++ b/circuitpython_uplot/scatter.py @@ -16,7 +16,7 @@ """ try: from typing import Optional, Union - from circuitpython_uplot.plot import Uplot + from circuitpython_uplot.plot import Plot except ImportError: pass @@ -36,7 +36,7 @@ class Scatter: def __init__( self, - plot: Uplot, + plot: Plot, x: Union[list, np.linspace, np.ndarray], y: Union[list, np.linspace, np.ndarray], rangex: Optional[list] = None, diff --git a/circuitpython_uplot/shade.py b/circuitpython_uplot/shade.py index f6953f3..de6ebb8 100644 --- a/circuitpython_uplot/shade.py +++ b/circuitpython_uplot/shade.py @@ -15,7 +15,7 @@ """ try: from typing import Optional, Union - from circuitpython_uplot.plot import Uplot + from circuitpython_uplot.plot import Plot except ImportError: pass from ulab import numpy as np @@ -33,7 +33,7 @@ class shade: def __init__( self, - plot: Uplot, + plot: Plot, x: Union[list, np.linspace, np.ndarray], y1: list, y2: list, @@ -43,7 +43,7 @@ def __init__( nudge: bool = True, ) -> 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|ulab.numpy.linspace|ulab.numpy.ndarray x: x points coordinates :param list y1: y1 points coordinates :param list y2: y2 points coordinates diff --git a/circuitpython_uplot/svg.py b/circuitpython_uplot/svg.py index 6abaf6d..b73f203 100644 --- a/circuitpython_uplot/svg.py +++ b/circuitpython_uplot/svg.py @@ -14,7 +14,7 @@ """ try: - from circuitpython_uplot.plot import Uplot + from circuitpython_uplot.plot import Plot except ImportError: pass from bitmaptools import draw_line @@ -33,7 +33,7 @@ class to render svg images in the plot area def __init__( self, - plot: Uplot, + plot: Plot, icon: dict, x: int, y: int, @@ -42,7 +42,7 @@ def __init__( ) -> None: """ - :param Uplot plot: Plot object for the log to be drawn + :param Plot plot: Plot object for the log to be drawn :param dictionary icon: icon dictionary :param int x: x position for the svg image :param int y: y position for the svg image diff --git a/docs/api.rst b/docs/api.rst index 1e052b5..5694701 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1,7 +1,7 @@ Uplot Library ============== -.. automodule:: circuitpython_uplot.uplot +.. automodule:: circuitpython_uplot.plot :members: .. automodule:: circuitpython_uplot.scatter diff --git a/docs/quick_start.rst b/docs/quick_start.rst index a16c8de..cee931c 100644 --- a/docs/quick_start.rst +++ b/docs/quick_start.rst @@ -3,13 +3,13 @@ A small tour for uplot. Plot Usage ============= -We start importing some fundamental libraries for uplot to operate +We start importing some fundamental libraries for plot to operate .. code-block:: python import board import displayio - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Plot For reference, screen in CircuitPython are defined from left to right and up to bottom. This means that our (x=0, y=0) will be in the left upper corner of the screen. @@ -25,9 +25,9 @@ We add the plot area. in this case we are selecting the whole screen as our plot .. code-block:: python - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) -The Uplot will be used to display our graphics. The position and the size of the plot area +The Plot will be used to display our graphics. The position and the size of the plot area could vary. This allows us to have more than 1 plot at the same time in the screen. Every one of them with different characteristics or graphs. @@ -80,10 +80,10 @@ library 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.uplot import Plot display = board.DISPLAY - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) roundrect = RoundRect(30, 30, 61, 81, 10, fill=0x0, outline=0xFF00FF, stroke=6) plot.append(roundrect) display.show(plot) @@ -93,9 +93,9 @@ library Ticks and Grid =============== Plot axes are shown by default. To change this behaviour you would need -to use the correct keyword in the `Uplot.axs_params` function: +to use the correct keyword in the `Plot.axs_params` function: -.. py:function:: Uplot.axs_params(axstype: Literal["box", "cartesian", "line"] = "box") +.. py:function:: Plot.axs_params(axstype: Literal["box", "cartesian", "line"] = "box") :param axstype: Option to display the axes @@ -108,13 +108,13 @@ The following snippet shows how to create a cartesian plot .. code-block:: python - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) plot.axs_params(axstype="cartesian") Tick spacing and numbers are selected by default. However it's possible to customize the following parameters: -.. py:function:: Uplot.tick_params(tickx_height, ticky_height, tickcolor, tickgrid) +.. py:function:: Plot.tick_params(tickx_height, ticky_height, tickcolor, tickgrid) :param int tickx_height: tickx_height in pixels :param int ticky_height: ticky_height in pixels @@ -139,7 +139,7 @@ You can choose some colors directly from the library. This can be done by import .. code-block:: python - from circuitpython_uplot.uplot import color + from circuitpython_uplot.plot import color This will allow you to use the colors in the list as color variable definitions * WHITE @@ -155,7 +155,7 @@ This will allow you to use the colors in the list as color variable definitions .. code-block:: python - plot = Uplot(0, 0, display.width, display.height, background_color=color.WHITE, box_color=color.BLACK) + plot = Plot(0, 0, display.width, display.height, background_color=color.WHITE, box_color=color.BLACK) @@ -171,10 +171,10 @@ to the `ulab` library .. code-block:: python from ulab import numpy as np - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Plot from circuitpython_uplot.cartesian import Cartesian display = board.DISPLAY - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) x = np.linspace(-4, 4, num=25) constant = 1.0 / np.sqrt(2 * np.pi) @@ -210,7 +210,7 @@ if you want to add more than un line to your plot, you could do something like t .. code-block:: python - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) x = np.linspace(-4, 4, num=25) y1 = x**2 / 2 y2 = 2 + x**2 + 3 * x @@ -223,17 +223,17 @@ if you want to add more than un line to your plot, you could do something like t Pie Chart =============== -You can easily create Pie charts with uplot. Pie Charts are limited to 6 elements as per the automatic coloring. +You can easily create Pie charts with plot. Pie Charts are limited to 6 elements as per the automatic coloring. To make the Pie Chart the data needs to be in a python list form. The library will take care of the rest .. code-block:: python import board - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.uplot import Plot from circuitpython_uplot.pie import Pie display = board.DISPLAY - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) a = [5, 2, 7, 3] Pie(plot, a) display.show(plot) @@ -251,11 +251,11 @@ Creates a scatter plot with x,y data. You can customize the circle diameter if y from random import choice import board from ulab import numpy as np - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.uplot import Plot from circuitpython_uplot.scatter import Scatter display = board.DISPLAY - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) a = np.linspace(1, 100) b = [choice(a) for _ in a] @@ -287,11 +287,11 @@ You can choose to create shell or filled bars. .. code-block:: python import board - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.uplot import Plot from circuitpython_uplot.bar import Bar display = board.DISPLAY - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) a = ["a", "b", "c", "d"] @@ -318,11 +318,11 @@ This will not work for shell bars sadly. .. code-block:: python import board - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.uplot import Plot from circuitpython_uplot.bar import Bar display = board.DISPLAY - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) Bar(plot, a, b, fill=True, bar_space=30, xstart=70, color_palette=[0xFF1000, 0x00FF00, 0x0000FF, 0x00FFFF]) @@ -332,11 +332,11 @@ appearance .. code-block:: python import board - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.uplot import Plot from circuitpython_uplot.bar import bar display = board.DISPLAY - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) a = ["a", "b", "c", "d"] @@ -351,11 +351,11 @@ according to this max value, and bar plot will update their values accordingly .. code-block:: python import board - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.uplot import Plot from circuitpython_uplot.bar import Bar display = board.DISPLAY - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) a = ["a", "b", "c", "d"] @@ -397,13 +397,13 @@ it will fill the area between two curves: import board from ulab import numpy as np - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.uplot import Plot from circuitpython_uplot.fillbetween import Fillbetween display = board.DISPLAY - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) x = np.linspace(0, 8, num=25) @@ -425,13 +425,13 @@ You can choose the initial and final colors for the color map. import board from ulab import numpy as np - from circuitpython_uplot.uplot import Uplot + from circuitpython_uplot.plot import Plot from circuitpython_uplot.map import Map display = board.DISPLAY - plot = Uplot(0, 0, display.width, display.height, show_box=False) + plot = Plot(0, 0, display.width, display.height, show_box=False) x = np.array( [ @@ -467,7 +467,7 @@ There are some parameters that you can customize: .. code-block:: python - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) x = [10, 20, 30, 40, 50] temp_y = [10, 15, 35, 10, 25] @@ -501,6 +501,6 @@ For example, if you want to load the Temperature icon with a scale of 2 from circuitpython_uplot.icons import Temperature display = board.DISPLAY - plot = Uplot(0, 0, display.width, display.height) + plot = Plot(0, 0, display.width, display.height) SVG(plot, Temperature, 250, 50, 2) display.show(plot) diff --git a/examples/uplot_bar_3Dbars.py b/examples/uplot_bar_3Dbars.py index 4b5aa75..907de9b 100644 --- a/examples/uplot_bar_3Dbars.py +++ b/examples/uplot_bar_3Dbars.py @@ -4,14 +4,14 @@ import time import board -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.bar import Bar # Setting up the display display = board.DISPLAY -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) # Setting up tick parameters plot.axs_params(axstype="box") diff --git a/examples/uplot_bar_color_changing.py b/examples/uplot_bar_color_changing.py index 3223432..65823ad 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.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.bar import Bar # Setting up the display @@ -15,7 +15,7 @@ DISPLAY_HEIGHT = 320 # Defining the plot -plot = Uplot( +plot = Plot( 0, 0, DISPLAY_WIDTH, diff --git a/examples/uplot_bar_colorpalette.py b/examples/uplot_bar_colorpalette.py index 98056f6..6fa245e 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.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.bar import Bar # Setting up the display @@ -14,7 +14,7 @@ DISPLAY_HEIGHT = 320 # Defining the plot -plot = Uplot( +plot = Plot( 0, 0, DISPLAY_WIDTH, diff --git a/examples/uplot_bar_example.py b/examples/uplot_bar_example.py index 49e3cd6..4345cfd 100644 --- a/examples/uplot_bar_example.py +++ b/examples/uplot_bar_example.py @@ -4,14 +4,14 @@ import time import board -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.bar import Bar # Setting up the display display = board.DISPLAY -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) # Setting up tick parameters plot.axs_params(axstype="box") diff --git a/examples/uplot_bar_scale_example.py b/examples/uplot_bar_scale_example.py index 4cf9c45..fb7a90f 100644 --- a/examples/uplot_bar_scale_example.py +++ b/examples/uplot_bar_scale_example.py @@ -5,10 +5,9 @@ import time import board import displayio -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.bar import Bar -# from uplot_examples import u8 # Setting up the display display = board.DISPLAY @@ -16,8 +15,8 @@ group = displayio.Group() # Creating the plot objects -plot_scale1 = Uplot(0, 0, 100, 100, 1, scale=1) -plot_scale2 = Uplot(125, 0, 100, 100, 1, scale=2) +plot_scale1 = Plot(0, 0, 100, 100, 1, scale=1) +plot_scale2 = Plot(125, 0, 100, 100, 1, scale=2) # Creating the data a = ["a", "b", "c", "d"] diff --git a/examples/uplot_bar_updating_values.py b/examples/uplot_bar_updating_values.py index 7b69fbd..6f4bf27 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.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.bar import Bar # Setting up the display @@ -15,7 +15,7 @@ DISPLAY_HEIGHT = 320 # Defining the plot -plot = Uplot( +plot = Plot( 0, 0, DISPLAY_WIDTH, diff --git a/examples/uplot_cartesian_advanced.py b/examples/uplot_cartesian_advanced.py index 9a1c2bc..4d2e51b 100644 --- a/examples/uplot_cartesian_advanced.py +++ b/examples/uplot_cartesian_advanced.py @@ -5,12 +5,12 @@ import time import board from ulab import numpy as np -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.cartesian import Cartesian # Setting up the display display = board.DISPLAY -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) # Creating some points to graph x = np.linspace(-4, 4, num=25) diff --git a/examples/uplot_cartesian_loggin_data.py b/examples/uplot_cartesian_loggin_data.py index c7ddd79..1937820 100644 --- a/examples/uplot_cartesian_loggin_data.py +++ b/examples/uplot_cartesian_loggin_data.py @@ -8,13 +8,13 @@ import terminalio import board from adafruit_display_text import label -from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.cartesian import Cartesian # Setting up the display display = board.DISPLAY -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) g = displayio.Group() DISPLAY_WIDTH = 200 @@ -41,7 +41,7 @@ g.append(text_humidity) -plot_1 = Uplot( +plot_1 = Plot( 0, 50, 200, @@ -52,7 +52,7 @@ background_color=color.WHITE, ) -plot_2 = Uplot( +plot_2 = Plot( 0, 180, 200, diff --git a/examples/uplot_cartesian_table.py b/examples/uplot_cartesian_table.py index cf042fb..142837d 100644 --- a/examples/uplot_cartesian_table.py +++ b/examples/uplot_cartesian_table.py @@ -6,7 +6,7 @@ import board from ulab import numpy as np from table import Table -from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.cartesian import Cartesian from circuitpython_uplot.shade import shade @@ -42,7 +42,7 @@ def heat_index(temp, humidity): display = board.DISPLAY # Adding the plot area -plot = Uplot(0, 0, display.width, display.height, padding=5) +plot = Plot(0, 0, display.width, display.height, padding=5) # Create a group to hold the objects g = displayio.Group() diff --git a/examples/uplot_display_shapes.py b/examples/uplot_display_shapes.py index 0994a2f..0d2686f 100644 --- a/examples/uplot_display_shapes.py +++ b/examples/uplot_display_shapes.py @@ -6,13 +6,13 @@ import board from adafruit_display_shapes.polygon import Polygon from adafruit_display_shapes.roundrect import RoundRect -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot # Setting up the display display = board.DISPLAY # Adding the plot area -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) # Setting up tick parameters plot.tick_params(tickx_height=12, ticky_height=12, tickcolor=0xFF0008, tickgrid=True) diff --git a/examples/uplot_fillbetween.py b/examples/uplot_fillbetween.py index c530f02..696b7bb 100644 --- a/examples/uplot_fillbetween.py +++ b/examples/uplot_fillbetween.py @@ -5,14 +5,14 @@ import time import board from ulab import numpy as np -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.fillbetween import Fillbetween # Setting up the display display = board.DISPLAY -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) x = np.linspace(0, 8, num=25) diff --git a/examples/uplot_integration_example.py b/examples/uplot_integration_example.py index 3ee22b1..0982a09 100644 --- a/examples/uplot_integration_example.py +++ b/examples/uplot_integration_example.py @@ -5,7 +5,7 @@ import board from ulab import numpy as np from uhistogram import Histogram -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.cartesian import Cartesian # Setting Up the histogram @@ -17,7 +17,7 @@ display = board.DISPLAY # Adding the plot area -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) # Seeting some date to plot x = np.linspace(-4, 4, num=50) diff --git a/examples/uplot_lissajous_curves.py b/examples/uplot_lissajous_curves.py index 34ddbc7..cc9272f 100644 --- a/examples/uplot_lissajous_curves.py +++ b/examples/uplot_lissajous_curves.py @@ -5,7 +5,7 @@ import math import board import displayio -from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.cartesian import Cartesian # Inspired by Paul McWhorter Raspberry Pi Pico W LESSON 27: Creating Lissajous Patterns @@ -37,10 +37,10 @@ def create_curve(a=1, b=2, mul_factor=10, delta=3.14 / 2): # Setting up the display display = board.DISPLAY -plot = Uplot(0, 0, display.width // 2, display.height // 2, padding=1) -plot2 = Uplot(240, 0, display.width // 2, display.height // 2, padding=1) -plot3 = Uplot(0, 160, display.width // 2, display.height // 2, padding=1) -plot4 = Uplot(240, 160, display.width // 2, display.height // 2, padding=1) +plot = Plot(0, 0, display.width // 2, display.height // 2, padding=1) +plot2 = Plot(240, 0, display.width // 2, display.height // 2, padding=1) +plot3 = Plot(0, 160, display.width // 2, display.height // 2, padding=1) +plot4 = Plot(240, 160, display.width // 2, display.height // 2, padding=1) g = displayio.Group() g.append(plot) g.append(plot2) diff --git a/examples/uplot_logging.py b/examples/uplot_logging.py index deebad6..69655a6 100644 --- a/examples/uplot_logging.py +++ b/examples/uplot_logging.py @@ -6,13 +6,13 @@ import terminalio import board from adafruit_display_text import label -from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.logging import Logging # Setting up the display display = board.DISPLAY -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) g = displayio.Group() DISPLAY_WIDTH = 200 @@ -38,7 +38,7 @@ text_humidity.anchored_position = 130, 0 g.append(text_humidity) -plot_1 = Uplot( +plot_1 = Plot( 0, 50, 200, diff --git a/examples/uplot_logging_animation.py b/examples/uplot_logging_animation.py index 7296201..60caa07 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.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.logging import Logging # Setting up the display @@ -14,7 +14,7 @@ display.auto_refresh = False # Drawing the graph -my_plot = Uplot( +my_plot = Plot( 140, 60, 200, diff --git a/examples/uplot_logging_changing_values.py b/examples/uplot_logging_changing_values.py index cc1f277..945e4b9 100644 --- a/examples/uplot_logging_changing_values.py +++ b/examples/uplot_logging_changing_values.py @@ -5,13 +5,13 @@ import time import displayio import board -from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.logging import Logging # Setting up the display display = board.DISPLAY -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) g = displayio.Group() DISPLAY_WIDTH = 200 @@ -28,7 +28,7 @@ g.append(t) -plot_1 = Uplot( +plot_1 = Plot( 0, 50, 200, diff --git a/examples/uplot_logging_fill.py b/examples/uplot_logging_fill.py index 15be1c9..24a2d5e 100644 --- a/examples/uplot_logging_fill.py +++ b/examples/uplot_logging_fill.py @@ -4,7 +4,7 @@ import displayio import board -from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.logging import Logging # Setting up the display @@ -16,7 +16,7 @@ palette = displayio.Palette(1) palette[0] = 0x000000 -plot_1 = Uplot( +plot_1 = Plot( 0, 0, 150, @@ -32,7 +32,7 @@ tickx_height=4, ticky_height=4, show_ticks=True, tickcolor=color.BLACK ) -plot_2 = Uplot( +plot_2 = Plot( 0, 150, 300, diff --git a/examples/uplot_logging_table.py b/examples/uplot_logging_table.py index d8d399a..962fee3 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.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.logging import Logging # Create a display object @@ -39,7 +39,7 @@ g = displayio.Group() # Create a plot object -plot_1 = Uplot( +plot_1 = Plot( 0, 50, 200, diff --git a/examples/uplot_map.py b/examples/uplot_map.py index 462a934..4eaacc1 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.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.map import Map @@ -14,7 +14,7 @@ display = board.DISPLAY # Adding the plot area -plot = Uplot(0, 0, display.width, display.height, show_box=False) +plot = Plot(0, 0, display.width, display.height, show_box=False) # Setting some date to plot x = np.linspace(-4, 4, num=100) diff --git a/examples/uplot_pie_example.py b/examples/uplot_pie_example.py index 6ea238f..69dac92 100644 --- a/examples/uplot_pie_example.py +++ b/examples/uplot_pie_example.py @@ -4,14 +4,14 @@ import time import board -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.pie import upie # Setting up the display display = board.DISPLAY -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) # Setting up tick parameters plot.axs_params(axstype="box") diff --git a/examples/uplot_plot_example.py b/examples/uplot_plot_example.py index afa844d..effe84e 100644 --- a/examples/uplot_plot_example.py +++ b/examples/uplot_plot_example.py @@ -5,14 +5,14 @@ import time import board from ulab import numpy as np -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.cartesian import Cartesian # Setting up the display display = board.DISPLAY # Adding the plot area -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) # Creating some points to graph x = np.linspace(-4, 4, num=25) diff --git a/examples/uplot_polar_example.py b/examples/uplot_polar_example.py index 9a2865b..9117de1 100644 --- a/examples/uplot_polar_example.py +++ b/examples/uplot_polar_example.py @@ -4,12 +4,12 @@ import board import ulab.numpy as np -from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.polar import Polar # Setting up the display display = board.DISPLAY -plot = Uplot(10, 10, 250, 250, padding=0, show_box=False) +plot = Plot(10, 10, 250, 250, padding=0, show_box=False) # Creating the data r = np.arange(0, 2, 0.01) diff --git a/examples/uplot_polar_plots.py b/examples/uplot_polar_plots.py index 24665ad..91d039e 100644 --- a/examples/uplot_polar_plots.py +++ b/examples/uplot_polar_plots.py @@ -5,7 +5,7 @@ import board import displayio import ulab.numpy as np -from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.cartesian import Cartesian # Inspired by @@ -14,10 +14,10 @@ # pylint: disable=dangerous-default-value # Setting up the display display = board.DISPLAY -plot = Uplot(0, 0, display.width // 2, display.height // 2, padding=1) -plot2 = Uplot(240, 0, display.width // 2, display.height // 2, padding=1) -plot3 = Uplot(0, 160, display.width // 2, display.height // 2, padding=1) -plot4 = Uplot(240, 160, display.width // 2, display.height // 2, padding=1) +plot = Plot(0, 0, display.width // 2, display.height // 2, padding=1) +plot2 = Plot(240, 0, display.width // 2, display.height // 2, padding=1) +plot3 = Plot(0, 160, display.width // 2, display.height // 2, padding=1) +plot4 = Plot(240, 160, display.width // 2, display.height // 2, padding=1) g = displayio.Group() g.append(plot) g.append(plot2) diff --git a/examples/uplot_readme_example.py b/examples/uplot_readme_example.py index 8b6efa4..19771de 100644 --- a/examples/uplot_readme_example.py +++ b/examples/uplot_readme_example.py @@ -6,7 +6,7 @@ import board import displayio from ulab import numpy as np -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.bar import Bar from circuitpython_uplot.scatter import Scatter from circuitpython_uplot.pie import Pie @@ -14,7 +14,7 @@ display = board.DISPLAY -plot = Uplot(0, 0, display.width, display.height, show_box=False) +plot = Plot(0, 0, display.width, display.height, show_box=False) group = displayio.Group() @@ -22,14 +22,14 @@ palette[0] = 0xFFFFFF -plot2 = Uplot(0, 0, 130, 130) +plot2 = Plot(0, 0, 130, 130) x = np.linspace(-4, 4, num=25) constant = 2.0 / np.sqrt(2 * np.pi) y = constant * np.exp((-(x**2)) / 4.0) Cartesian(plot2, x, y, rangex=[-5, 5], rangey=[0, 1]) plot.append(plot2) -plot3 = Uplot(130, 0, 160, 160) +plot3 = Plot(130, 0, 160, 160) # Setting up tick parameters plot3.tick_params(tickx_height=12, ticky_height=12, tickcolor=0xFF00FF, tickgrid=True) @@ -43,7 +43,7 @@ Cartesian(plot3, x, y, rangex=[-5, 5], rangey=[0, 0.5]) plot.append(plot3) -plot4 = Uplot(290, 0, 150, 150) +plot4 = Plot(290, 0, 150, 150) # Setting up tick parameters plot4.axs_params(axstype="box") @@ -53,7 +53,7 @@ plot.append(plot4) -plot5 = Uplot(0, 180, 120, 120) +plot5 = Plot(0, 180, 120, 120) # Setting up tick parameters plot5.axs_params(axstype="cartesian") @@ -63,7 +63,7 @@ plot.append(plot5) -plot6 = Uplot(130, 160, 150, 150) +plot6 = Plot(130, 160, 150, 150) # Setting up tick parameters plot6.axs_params(axstype="box") @@ -74,7 +74,7 @@ plot.append(plot6) -plot7 = Uplot(290, 160, 150, 150) +plot7 = Plot(290, 160, 150, 150) # Creating some points to graph x = np.linspace(1, 10, num=10) diff --git a/examples/uplot_scatter.py b/examples/uplot_scatter.py index 8782450..7bf7828 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.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.scatter import Scatter @@ -14,7 +14,7 @@ display = board.DISPLAY # Adding the plot area -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) # Setting up tick parameters plot.tick_params(tickx_height=12, ticky_height=12, tickcolor=0xFF0008, tickgrid=True) diff --git a/examples/uplot_shade_example.py b/examples/uplot_shade_example.py index f3bf477..b28722e 100644 --- a/examples/uplot_shade_example.py +++ b/examples/uplot_shade_example.py @@ -5,7 +5,7 @@ import time import board from ulab import numpy as np -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.cartesian import Cartesian from circuitpython_uplot.shade import shade @@ -19,7 +19,7 @@ display = board.DISPLAY # Adding the plot area -plot = Uplot(0, 0, display.width, display.height, padding=5) +plot = Plot(0, 0, display.width, display.height, padding=5) def heat_index(temp, humidity): diff --git a/examples/uplot_simpletest.py b/examples/uplot_simpletest.py index 0063af9..80f91b8 100644 --- a/examples/uplot_simpletest.py +++ b/examples/uplot_simpletest.py @@ -4,13 +4,13 @@ import time import board -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot # Setting up the display display = board.DISPLAY # Adding the plot area -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) plot.draw_circle(radius=8, x=120, y=120) diff --git a/examples/uplot_sparkline.py b/examples/uplot_sparkline.py index b5366f7..740b2cb 100644 --- a/examples/uplot_sparkline.py +++ b/examples/uplot_sparkline.py @@ -6,14 +6,14 @@ import board from ulab import numpy as np from adafruit_display_shapes.sparkline import Sparkline -from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color # Setting up the display display = board.DISPLAY # Adding the plot area -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) # 500 linearly spaced numbers x = np.linspace(-10 * np.pi, 10 * np.pi, 500) diff --git a/examples/uplot_stackplot.py b/examples/uplot_stackplot.py index 6239758..b6bc0d8 100644 --- a/examples/uplot_stackplot.py +++ b/examples/uplot_stackplot.py @@ -8,12 +8,12 @@ import time import board from ulab import numpy as np -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot from circuitpython_uplot.cartesian import Cartesian # Setting up the display display = board.DISPLAY -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) # Creating some points to graph x = np.linspace(1, 10, num=10) diff --git a/examples/uplot_svg_example.py b/examples/uplot_svg_example.py index 7aba1d1..a20fb75 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.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.svg import SVG from circuitpython_uplot.icons import FULL, Humidity, Temperature, Temperature2 @@ -11,7 +11,7 @@ # Setting up the display display = board.DISPLAY -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) SVG(plot, FULL, 50, 50, 2, color.YELLOW) SVG(plot, Humidity, 150, 50, 2, color.TEAL) SVG(plot, Temperature, 250, 50, 2, color.GREEN) diff --git a/examples/uplot_tickparameters.py b/examples/uplot_tickparameters.py index a77d414..2f51130 100644 --- a/examples/uplot_tickparameters.py +++ b/examples/uplot_tickparameters.py @@ -5,7 +5,7 @@ import time import board from ulab import numpy as np -from circuitpython_uplot.plot import Uplot, color +from circuitpython_uplot.plot import Plot, color from circuitpython_uplot.cartesian import Cartesian @@ -13,7 +13,7 @@ display = board.DISPLAY # Setting up the plot area -plot = Uplot( +plot = Plot( 0, 0, display.width, diff --git a/examples/uplot_uboxplot.py b/examples/uplot_uboxplot.py index eb245bd..20fb2c5 100644 --- a/examples/uplot_uboxplot.py +++ b/examples/uplot_uboxplot.py @@ -2,17 +2,17 @@ # # SPDX-License-Identifier: MIT """ -Simple test to display boxplot using uplot +Simple test to display boxplot using plot """ import board from uboxplot import Boxplot -from circuitpython_uplot.plot import Uplot +from circuitpython_uplot.plot import Plot display = board.DISPLAY -plot = Uplot(0, 0, display.width, display.height) +plot = Plot(0, 0, display.width, display.height) plot.tick_params(tickx_height=10, ticky_height=10, tickcolor=0x440008, tickgrid=True)