当前位置:网站首页>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, '边栏推荐
猜你喜欢

Linear programming of mathematical modeling (including Matlab code)

tail -f 、tail -F、tailf的区别

Rk3568 development board evaluation (II): development environment construction

Find a benchmark comrade in arms | a million level real-time data platform, which can be used for free for life
![leetcode:701. Insertion in binary search tree [BST insertion]](/img/bc/1dda73198488eb81b49be2c1dff6c2.png)
leetcode:701. Insertion in binary search tree [BST insertion]

数学建模之线性规划(含MATLAB代码)
![[love crash] neglected details of gibaro](/img/d6/baa4b5185ddaf88f3df71a94a87ee2.jpg)
[love crash] neglected details of gibaro
![[case sharing] let the development of education in the new era advance with](/img/11/af88d16dc66f00840cbfc5ba5d68bd.jpg)
[case sharing] let the development of education in the new era advance with "number"

Excel removes the data after the decimal point and rounds the number

leetcode:871. 最低加油次数【以前pat做过 + 最大堆 +贪心】
随机推荐
Reading and writing speed of Reza rz/g2l arm development board storage and network measurement
[AUTOSAR XIII NVM]
mysql 多表联合删除
【爱死机】《吉巴罗》被忽略的细节
删除有序链表中重复的元素-II
KingbaseES ALTER TABLE 中 USING 子句的用法
【C语言】分支和循环语句(上)
Trois tâches principales: asynchrone, courrier et timing
How to convert Quanzhi a40i/t3 to can through SPI
JS inheritance and prototype chain
RISA rz/g2l processor introduction | frame diagram | power consumption | schematic diagram and hardware design guide
用Go+绘制爱心给心爱的她表白
Find a benchmark comrade in arms | a million level real-time data platform, which can be used for free for life
Excel if formula determines whether the two columns are the same
[flutter] icons component (fluttericon Download Icon | customize SVG icon to generate TTF font file | use the downloaded TTF icon file)
Inversion de l'intervalle spécifié dans la liste des liens
excel表格计算时间日期的差值,并转化为分钟数
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
MySQL multi table joint deletion
Deep analysis of data storage in memory