Тёмный

Plot Graph with Python & Kivy (Kivy Garden Graph) which works on Android 

Full Stack Lab
Подписаться 2,6 тыс.
Просмотров 10 тыс.
50% 1

This tutorial demonstrates how to use the Kivy framework for Python to create an app which plots a sine wave and which actually works on your android smartphone (unlike Matplotlib). It's for beginners and advanced users of Kivy and Python.
If anything is unclear, feel free to ask and write a comment.
▬ Links ► ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Code of this tutorial:
github.com/denczo/kivy_examples
Build and Deploy the app:
• Build & Deploy Kivy Py...
Python Installer:
www.python.org/downloads/
Kivy Framework:
bit.ly/3tIIXHT
Kivy Garden Graph:
kivy.org/doc/stable/api-kivy....
kivy-garden.github.io/graph/f...
Error Handling:
supportuae.wordpress.com/2019...
▬ Commands ► ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
sudo apt-get update -y
sudo apt-get install python3
sudo apt install python3-pip
sudo apt install git
pip3 install kivy
pip3 install numpy
pip3 install kivy-garden.graph
▬ Chapters ► ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Start:
► 0:00 - Intro
► 0:44 - Basic Setup
► 2:42 - Short Summary of Kivy
► 3:17 - How to plot a Graph on Android
Coding:
► 3:45 - Basic Kivy Application (Hello World)
► 8:05 - Slider Widget
► 12:13 - Graph Widget (with Sine Wave)
► 17:33 - Update Plot with Slider
► 19:35 - Styling Graph Widget
► 22:00 - Zoom Buttons
► 24:19 - Set Background Color
► 25:53 - Zoom Feature (ScrollView Widget)
► 37:43 - Outro
▬ Programming ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
► Pycharm Community Edition
► Python 3.8.1
► Kivy 2.0
▬ Editing ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
► Sony Vegas Pro Edit 14
► OBS
► t.bone SC400
► Cheap Webcam

Опубликовано:

 

30 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 37   
@gecko23094
@gecko23094 Год назад
Great Work! I'm installing Kivy now to try out your work. Consider me inspired.
@marektengler6033
@marektengler6033 2 месяца назад
Even after 2 years work like a charm, thanks!
@fullstacklab
@fullstacklab 2 месяца назад
You're welcome :)
@Samssh-t
@Samssh-t 2 года назад
Mashalla einfach der Hübsche
@carlesinglada923
@carlesinglada923 Год назад
Thanks for this video. It's very useful.
@hughnorris675
@hughnorris675 2 года назад
To anyone who's facing the error "No module named 'kivy_garden", the solution is to manually go to cmd (pure python) or Anaconda Prompt (for conda users) and type: pip install kivy-garden.graph Yikes! And of course: THANKS to Denicz for this amazing tutorial!
@a_s_9992
@a_s_9992 2 года назад
I tried this it says requirement already satisfied but when I call it on pycharm it doesn't work. Says no module found
@hughnorris675
@hughnorris675 2 года назад
@@a_s_9992 Do you have the correct python interpreter selected on PyCharm? Clicking on it, you can manually see the installed libraries. Otherwise, maybe the best option is to provide a piece of your code or some screenshot on StackOverflow (for example), to get a more in-depth solution :D
@a_s_9992
@a_s_9992 2 года назад
@@hughnorris675 yeh the interpreter is set up correctly as well. Kivy is so frustrating haha, always run into errors.
@a_s_9992
@a_s_9992 2 года назад
@@hughnorris675 Just ran the code through the terminal it works, but it was flagging with errors with VSC and pycharm about the kivy_garden module. Very strange
@hughnorris675
@hughnorris675 2 года назад
@@a_s_9992 Totally agree! That module is from 7-8 years ago, so maybe there are still a bunch of bugs in the library Regardless that, as long as my code copiles, I'll keep using it 😂
@fullstacklab
@fullstacklab 2 года назад
Btw Matplotlib seems to work again with kivy on android according to this post on stackoverflow: stackoverflow.com/questions/63887380/kivy-app-crash-in-android-but-not-in-pc-buildozer-keyerror-kivy-garden-matpl/63895018#63895018
@a_s_9992
@a_s_9992 2 года назад
Is there a way to plot dates in the x axis and numbers in the y axis with this library
@natureloverJ
@natureloverJ 10 месяцев назад
Regarding audio app. How to install audiostream library. Couldn't find.
@bigbadcatbigbcy2933
@bigbadcatbigbcy2933 10 месяцев назад
hello. can we make pie charts using garden graph?
@dermoehre_live
@dermoehre_live 2 года назад
Hi Denicz, realls nice video :-) It helped me alot. Do you know, if there is a function in Graph, on how to add numbers on the y-scale and something like a legend, if you need more than one lineplot?
@fullstacklab
@fullstacklab 2 года назад
Thank you :) Adding numbers on the y-scale works the same as for the x-scale. There don't seem to be legends. Unfortunately, the library is really basic.
@pa6552
@pa6552 2 года назад
Hi! Thank you so much for this! Really easy to follow! I was just wondering if you could do a follow up or lead me to adapt your example a bit so I can plot live sensor data over serial port from an arduino?
@daantimmer
@daantimmer Год назад
I wonder how/and why your example works for you, but not for me. In my __init__ function of my custom widget the 'ids' variable is not populated yet. Thus I can't access the 'modulation' widget by ID. I have to resort to using a clock-schedule-once approach to await the whole chain of widgets to be constructed in order to access the 'ids' variable which then is finally populated. Any ideas? I am on kivy 2.1.0 and python 3.10.5
@nuton9706
@nuton9706 26 дней назад
I get the same problem. If you have figured out by any chance please let me know
@morteza7298
@morteza7298 Год назад
hi there, hope you have a wonderful day, I have a question, is there anyway that I can make interactive graphs in kivy? like when I click somewhere on my graph, it shows some properties
@fullstacklab
@fullstacklab Год назад
Hey Morteza! Interactive graphs are not possible with the library kivy_garden which is used in this video. For this case Matplotlib would be the correct choice which seems to work again on Android. But I haven't tested this out yet.
@carlosalbertochacon8178
@carlosalbertochacon8178 2 года назад
Hi! I have installed kivy-garden v0.1.4 with Coda in the project environment... But, i am got the following error message: No module named 'kivy_garden' ... Any ideas on how to fix it ? thanks !!
@fullstacklab
@fullstacklab 2 года назад
i haven't really used Conda yet. But at least with the python installer from python.org and pip, you sometimes need to restart Pycharm. You also need to make sure, that you have selected the correct python interpreter (if you have more than one installed)
@carlosalbertochacon8178
@carlosalbertochacon8178 2 года назад
@@fullstacklab Ok i will try that, thanks Denicz
@pa6552
@pa6552 2 года назад
@@carlosalbertochacon8178 you forgot to run : pip3 install kivy-garden.graph
@Tcrunz
@Tcrunz 2 года назад
for future viewers, I also had this problem: `import kivy.garden` (instead of kivy_garden) worked for me.
@demo9644
@demo9644 2 года назад
Sir, please make a video on how to use matplotlib with kivy on android
@fullstacklab
@fullstacklab 2 года назад
How would you use this for your own app? :)
@zerobudget1041
@zerobudget1041 2 года назад
When is the next video coming out? Do you also have tutorials for more advanced styling with Kivy?
@fullstacklab
@fullstacklab 2 года назад
@@zerobudget1041 The next video will be probably released this month. What do you have in mind when you think of advanced styling?
@zerobudget1041
@zerobudget1041 2 года назад
@@fullstacklab I've actually began to figure it advanced styling (like combining button behavior with images to create custom buttons), so I'm good there. Thanks tho, still looking forward to the video.
@julienbensliman101
@julienbensliman101 6 месяцев назад
Is it possible to make barplot? 😊
@fullstacklab
@fullstacklab 6 месяцев назад
Hey Julien! Well, it should be possible. There is no documentation but if you look at the github repository there is a class called BarPlot. So instead of importing MeshPlot try to import BarPlot and use the proper Methods with it. github.com/kivy-garden/graph/blob/master/kivy_garden/graph/__init__.py
@fullstacklab
@fullstacklab 2 года назад
how to deploy the app to android: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-pzsvN3fuBA0.html
Далее