Open
Description
i think it would make a nice addition to be able to plot multiple lines in the same Cartesian.
what i think needs to be done for this:
- extract line drawing to sub-class
- the subclass could be an self contained bitmap or group (what makes more sense here?)
- change to
add point
function - add
draw
orupdate
function (what is the better naming here?) - color option
handle multiple Plot-Classes
please let me know what you think!
Activity
kmatch98 commentedon Feb 13, 2022
I’m considering the requested updates to the Cartesian widget. Main updates are to allow for multiple lines to be drawn but also a few more things I’ve got in mind:
I am considering updating this to use vectorio rather than the current version that draws on a bitmap. I’m unsure if that will save RAM, likely will depend upon how many points and lines are included.
Some initial thoughts on the implementation:
Line data uses a new Class
Has class functions to return a vectorio representation given an x,y range.
Include an _update function:
None
, calculate the graph’s x and y range.jposada202020 commentedon Jan 20, 2023
@s-light and @kmatch98 Interesting, Love the ideas. We start to play with Vectorio in CP 7.0 If memory is accurate, and the development of this library was done on CP 6.XX. We played with some of @s-light ideas in these libraries that could that could improve the library. https://github.com/jposada202020/CircuitPython_ArrowLine and https://github.com/jposada202020/CircuitPython_Candlesticks. Anyway sorry for the late answer. @kmatch98 You know more about memory than me for sure :) so any advice is welcome :)
Also there was this https://github.com/romilly/microplot project that could help as inspiration.
jposada202020 commentedon Feb 11, 2023
Hello, again :)
I have revisiting again this. Went in a completely different direction. I wanted to add different elements on the plot, including the vectorio, and adafruit_display_shapes library. see my progress here
https://github.com/jposada202020/CircuitPython_uplot
Take a look to the capabilities here, including adding different graphs in the same plot_area
https://circuitpython-uplot.readthedocs.io/en/latest/examples.html
Not sure if we want to add more features!?. For example the fesature to draw under the curve done by @tekktrik was pr in CircuitPython_Org and not here. I would continue the work in uplot and releasing the library in the community bundle if anyone is interested. Thanks :)