How to add Matplotlib graph in Kivy ? Last Updated : 05 Apr, 2021 Comments Improve Suggest changes Like Article Like Report In this article, we will discuss how to add matplotlib graph in the kivy app. Approach:Import matplotlib pyplotImport numpyImport FigureCanvas KivyAggImport kivy appImport kivy builderCreate App classReturn builder stringRun an instance of the class Below is the Implementation. Python3 # importing pyplot for graph plotting from matplotlib import pyplot as plt # importing numpy import numpy as np from kivy.garden.matplotlib import FigureCanvasKivyAgg # importing kivyapp from kivy.app import App # importing kivy builder from kivy.lang import Builder # this is the main class which will # render the whole application class uiApp(App): def build(self): self.str = Builder.load_string(""" BoxLayout: layout:layout BoxLayout: id:layout """) signal = [7, 89.6, 45.-56.34] signal = np.array(signal) # this will plot the signal on graph plt.plot(signal) # setting x label plt.xlabel('Time(s)') # setting y label plt.ylabel('signal (norm)') plt.grid(True, color='lightgray') # adding plot to kivy boxlayout self.str.layout.add_widget(FigureCanvasKivyAgg(plt.gcf())) return self.str # running the application uiApp().run() Output: Note: When you run the below code this may throw the error given below What you have to do is open the file given in the white box by clicking on file while holding ctrl key and comment line underlined by green color in that file and hit save now you will be able to run it!! Comment More infoAdvertise with us Next Article How to add Matplotlib graph in Kivy ? Y yashmathur123123 Follow Improve Article Tags : Python Python-kivy Practice Tags : python Similar Reads How to plot a dashed line in matplotlib? Matplotlib is used to create visualizations and plotting dashed lines is used to enhance the style and readability of graphs. A dashed line can represent trends, relationships or boundaries in data. Below we will explore how to plot and customize dashed lines using Matplotlib. To plot dashed line:Sy 2 min read How to add a grid on a figure in Matplotlib ? Matplotlib library is widely used for plotting graphs. In many graphs, we require to have a grid to improve readability. Grids are created by using grid() function in the Pyplot sublibrary. In this article, we will see how to add grid in Matplotlb. Add a Grid on a Figure in MatplotlibBelow are the w 3 min read How to add text to Matplotlib? Matplotlib is a plotting library in Python to visualize data, inspired by MATLAB, meaning that the terms used (Axis, Figure, Plots) will be similar to those used in MATLAB. Pyplot is a module within the Matplotlib library which is a shell-like interface to Matplotlib module. Â It provides almost any 5 min read Line chart in Matplotlib - Python Matplotlib is a data visualization library in Python. The pyplot, a sublibrary of Matplotlib, is a collection of functions that helps in creating a variety of charts. Line charts are used to represent the relation between two data X and Y on a different axis. In this article, we will learn about lin 6 min read Matplotlib.pyplot.draw() in Python matplotlib.pyplot.draw() function redraw the current figure in Matplotlib. Unlike plt.show(), it does not block the execution of code, making it especially useful in interactive sessions, real-time visualizations where the plot needs to update dynamically without pausing the program. Example: Python 2 min read Like