You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/quick_start.rst
+48-15Lines changed: 48 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -273,9 +273,9 @@ This can be done by importing the color class, from the cartesian library:
273
273
274
274
.. code-block:: python
275
275
276
-
from circuitpython_uplot.plotimport LineStyle
276
+
from circuitpython_uplot.cartesianimport LineStyle
277
277
278
-
You could select a dotted line by using the following code: ``line_style=LineStyle.DOTTED``.
278
+
You can select a dotted line by using the following code: ``line_style=LineStyle.DOTTED``.
279
279
280
280
.. code-block:: python
281
281
@@ -328,7 +328,8 @@ Creates a scatter plot with x,y data. You can customize the circle diameter if y
328
328
There are some parameters that you can customize:
329
329
* rangex and rangey: you can specify the ranges of your graph. This allows you to move your graph according to your needs. This parameters only accept lists
330
330
* radius: circles radius/radii. If a different value is given for each point, the radius should be a list of values. If selected pointer is not a circle, this parameter will be ignored
331
-
* pointer_color: you can specify the color in HEX
331
+
* pointer_color: you can specify the color in HEX. Or you could use the color class as explained above.
332
+
* pointer: you can select the pointer shape. The default is a circle. See below for more details
332
333
* nudge: this parameter allows you to move the graph slighty. This is useful when the data start/end in the limits of your range
333
334
334
335
@@ -340,12 +341,33 @@ There are some parameters that you can customize:
340
341
b = [choice(a) for _ in a]
341
342
Scatter(plot, a, b, rangex=[0,210], rangey=[0, 210], radius=radi, pointer_color=0xF456F3)
342
343
344
+
345
+
Pointer styles
346
+
==============
347
+
You can select the pointer style of your Scatter graph. The following pointer styles are available:
348
+
* Pointer.CIRCLE
349
+
* Pointer.SQUARE
350
+
* Pointer.TRIANGLE
351
+
* Pointer.DIAMOND
352
+
353
+
This can be done by importing the color class, from the cartesian library:
354
+
355
+
.. code-block:: python
356
+
357
+
from circuitpython_uplot.scatter import Pointer
358
+
359
+
You can select a square pointer using the following code: ``pointer=Pointer.SQUARE``.
360
+
361
+
.. code-block:: python
362
+
363
+
Scatter(plot, a, b, pointer=Pointer.SQUARE)
364
+
343
365
===============
344
366
Bar Plot
345
367
===============
346
368
347
369
Allows you to graph bar plots. You just need to give the values of the bar in a python list.
348
-
You can choose to create shell or filled bars.
370
+
You can choose to create shell or filled bars or 3D projected bars.
349
371
350
372
.. code-block:: python
351
373
@@ -362,21 +384,21 @@ You can choose to create shell or filled bars.
362
384
Bar(plot, a, b)
363
385
364
386
365
-
You can select the color orand if the bars are filled
387
+
You can select the color or/and if the bars are filled
366
388
367
389
.. code-block:: python
368
390
369
-
Bar(plot, a, b, 0xFF1000, True)
391
+
Bar(plot, a, b, color=0xFF1000, fill=True)
370
392
371
393
372
394
You can also select the bar spacing and the xstart position:
373
395
374
396
.. code-block:: python
375
397
376
-
Bar(plot, a, b, 0xFF1000, fill=True, bar_space=30, xstart=70)
398
+
Bar(plot, a, b, color=0xFF1000, fill=True, bar_space=30, xstart=70)
377
399
378
400
For bar filled graphs you can pass a color_palette list. This will allow you to select the color of each bar
379
-
This will not work for shell bars sadly.
401
+
This will not work for shell bars.
380
402
381
403
.. code-block:: python
382
404
@@ -389,7 +411,7 @@ This will not work for shell bars sadly.
389
411
Bar(plot, a, b, fill=True, bar_space=30, xstart=70, color_palette=[0xFF1000, 0x00FF00, 0x0000FF, 0x00FFFF])
390
412
391
413
392
-
with the projection argument you can show the bars with projection. This will give them a 3D
414
+
With the projection argument you can show the bars with projection. This will give them a 3D
393
415
appearance
394
416
395
417
.. code-block:: python
@@ -407,7 +429,7 @@ appearance
407
429
Bar(plot, a, b, color=0xFF1000, fill=True, bar_space=30, xstart=70, projection=True)
408
430
409
431
410
-
For filled unprojected bars you can update their values. This is useful for data logging.
432
+
For filled unprojected bars you can update their values in real time. This is useful for data logging.
411
433
The max_value argument will allow you to set the maximum value of the graph. The plot will scale
412
434
according to this max value, and bar plot will update their values accordingly
413
435
@@ -425,7 +447,7 @@ according to this max value, and bar plot will update their values accordingly
0 commit comments