当前位置:网站首页>kivy教程之在 Kivy App 中使用 matplotlib 的示例
kivy教程之在 Kivy App 中使用 matplotlib 的示例
2022-07-03 00:46:00 【知识大胖】
我们想在我们的 GUI 应用程序中添加数据可视化模块是很常见的。在 Kivy 中,可以使用 garden.matplotlib
来实现。但是没有一个很好的例子来说明如何在实际应用程序中使用它。我在stackoverflow上遇到了这个帖子,并认为这是一个很好的例子,可以用作模板。所以我根据答案和评论更新了代码以使其工作。您可以在下面的 gif 中查看详细信息:
from kivy.properties import ObjectProperty
from kivy.uix.screenmanager import ScreenManager, Screen
from kivymd.app import MDApp
from kivymd.uix.expansionpanel import MDExpansionPanel, MDExpansionPanelOneLine
from kivy.uix.boxlayout import BoxLayout
import matplotlib.pyplot as plt
from kivy.garden.matplotlib.backend_kivyagg import FigureCanvasKivyAgg
from kivy.uix.image import Image
from kivy.lang import Builder
kv_str = """
<WindowManager>:
LoginWindow:
TravelManagerWindow:
<LoginWindow>:
name: 'login'
MDRaisedButton:
text: 'Enter'
pos_hint: {'center_x': 0.5, '
边栏推荐
- leetcode-871:最低加油次数
- [AUTOSAR + IO Architecture]
- [shutter] image component (configure local GIF image resources | load placeholder with local resources)
- excel IF公式判断两列是否相同
- 全志A40i/T3如何通过SPI转CAN
- Arduino开发之按键检测与正弦信号输出
- Esp32 simple speed message test of ros2 (limit frequency)
- Array and collection performance comparison
- 瑞萨RZ/G2L ARM开发板存储读写速度与网络实测
- Kivy教程大全之如何在 Kivy 中创建下拉列表
猜你喜欢
随机推荐
The R language uses the ctree function in the party package to build conditional inference decision trees, uses the plot function to visualize the trained conditional inference decision tree, and the
Key detection and sinusoidal signal output developed by Arduino
excel去除小数点后面的数据,将数字取整
R language uses coin package to apply permutation tests to independence problems (permutation tests, whether response variables are independent of groups, are two numerical variables independent, and
Correctly distinguish the similarities and differences among API, rest API, restful API and web service
删除有序链表中重复的元素-II
Data analysis, thinking, law breaking and professional knowledge -- analysis method (I)
MongoDB系列之MongoDB常用命令
Rk3568 development board evaluation (II): development environment construction
正确甄别API、REST API、RESTful API和Web Service之间的异同
1696C. Fishingprince Plays With Array【思维题 + 中间状态 + 优化存储】
Foundations of data science is free to download
tail -f 、tail -F、tailf的区别
瑞萨RZ/G2L 处理器简介|框架图|功耗|原理图及硬件设计指南
[case sharing] let the development of education in the new era advance with "number"
Draw love with go+ to express love to her beloved
[AUTOSAR five methodology]
Leetcode-1964: find the longest effective obstacle race route to each position
leetcode-934:最短的桥
攻克哈希的基本概念与实现