EEVblog Electronics Community Forum
Products => Computers => Programming => Topic started by: RoGeorge on December 25, 2023, 11:16:58 am
-
Pyplot is great, though each time I want to be more specific with a chart, I have to search online for hours until I find the right options and the right syntax to produce the desired look.
Is there any helper, preferably an offline GUI, from where to configure the appearance of a chart, and from which to generate the corresponding pyplot code, so to embed that code in my programs?
Something like the charts wizard from any spreadsheet would be enough, doesn't has to cover each and every pyplot feature. I've searched for 'pyplot wizard' and couldn't find any.
If no wizard tool, then what to use for discoverability? How to personalize a pyplot chart without spending half a day digging through the docs and through stackoverflow?
-
There isn't a wizard.
If no wizard tool, then what to use for discoverability? How to personalize a pyplot chart without spending half a day digging through the docs and through stackoverflow?
Did you actually try to look at the Matplotlib documentation? It is excellent and the example page shows both various plots and the code needed to produce them. It is quite easy to crib the bits you need from there.
https://matplotlib.org/stable/gallery/index.html
And I hope you have spent a bit of time with the tutorial and documentation in general:
https://matplotlib.org/stable/tutorials/index.html
https://matplotlib.org/stable/users/index.html
You can also always try to have something like ChatGPT generate the code for you but the quality will inevitably wary. Caveat emptor.
-
Exactly, give ChatGPT 4 a try. It's unreasonably effective at turning English into Python.
-
Thank you, will stay with the tedious search and copy/paste stitching, then. :-//
Meanwhile, found it to be more productive to export to LTspice, and visualize the data as LTspice plots. :D
-
I find Lux (https://github.com/lux-org/lux) useful for quick exploratory stuff initially, and you can grab its outputs as code to then customize if you want to tweak them or do something similar that it doesn't on its own. Also sometimes streamlit (https://streamlit.io/) for tweaking values/ranges/etc... too, if that's a need.
-
In the official pyplot tutorials, there is a link to this blog post:
https://pbpython.com/effective-matplotlib.html :-+
I wish I could have read that post before using matplotlib.
Good as pyplot reminder brief for the infrequent user, too.
(https://pbpython.com/images/matplotlib-pbpython-example-header.png)
Source: https://pbpython.com/effective-matplotlib.html
(https://matplotlib.org/2.0.2/_images/anatomy1.png)
Source: https://matplotlib.org/2.0.2/faq/usage_faq.html
https://matplotlib.org/cheatsheets/