当前位置:网站首页>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, '边栏推荐
- Matlab finds the position of a row or column in the matrix
- Thank you for being together for these extraordinary two years!
- 18_ The wechat video number of wechat applet scrolls and automatically plays the video effect to achieve 2.0
- Asynchronous, email and scheduled tasks
- 测试右移:线上质量监控 ELK 实战
- 1696C. Fishingprince Plays With Array【思维题 + 中间状态 + 优化存储】
- Explain the basic concepts and five attributes of RDD in detail
- RISA rz/g2l processor introduction | frame diagram | power consumption | schematic diagram and hardware design guide
- Kubernetes resource object introduction and common commands (V) - (NFS & PV & PVC)
- MySQL multi table joint deletion
猜你喜欢
![[flutter] icons component (load the built-in icon of flutter | display the material design icon completely)](/img/f5/3ec22f1480227f33a1c8ac457155ed.jpg)
[flutter] icons component (load the built-in icon of flutter | display the material design icon completely)

Matlab Doppler effect produces vibration signal and processing
![[AUTOSAR XIII NVM]](/img/38/805ab70f199e2cfad4d9dae0e2c1ff.png)
[AUTOSAR XIII NVM]

测试右移:线上质量监控 ELK 实战
![[AUTOSAR + IO Architecture]](/img/cf/9ea42b50bed298c0546764b63bd957.png)
[AUTOSAR + IO Architecture]

Trois tâches principales: asynchrone, courrier et timing

详解RDD基本概念、RDD五大属性

Arduino开发之按键检测与正弦信号输出

1696C. Fishingprince Plays With Array【思维题 + 中间状态 + 优化存储】

Basic use of sringcloud & use of component Nacos
随机推荐
[AUTOSAR VI description document]
leetcode-224:基本计算器
Matlab finds the position of a row or column in the matrix
leetcode-241:为运算表达式设计优先级
[case sharing] let the development of education in the new era advance with "number"
测试右移:线上质量监控 ELK 实战
【C语言】分支和循环语句(上)
The difference between tail -f, tail -f and tail
无向图的割点
Matlab saves the digital matrix as geospatial data, and the display subscript index must be of positive integer type or logical type. Solve the problem
Thread start and priority
leetcode-2280:表示一个折线图的最少线段数
leetcode:701. Insertion in binary search tree [BST insertion]
What is needed to develop a domestic arm intelligent edge computing gateway
Rk3568 development board evaluation (II): development environment construction
465. 最优账单平衡 DFS 回溯
数学建模之线性规划(含MATLAB代码)
Cut point of undirected graph
递归处理组织的几种情况
JS inheritance and prototype chain