Skip to main content
Dynamics 365 general forum
Unanswered

Dynamically plotting data real time quickly

editSubscribe (0) ShareShare
ReportReport
Posted on by 2
I'm currently trying to plot some data that is being generated realtime from a simulation, this portion of code is a simplified version of what I have right now. It works but it is incredibly slow. Are there any tricks or other methods to speed this up.
My simplified code:
import matplotlib.pyplot as pltimport numpy as npimport timeplt.ion()class plotting_class():    def __init__(self):        self.x = []        self.y = []        self.fig, self.ax = plt.subplots()    def plotting(self,i):        # for i in range(20):        self.x.append(i)        self.y.append(5*i)        self.ax.plot(self.x, self.y, 'b')        self.fig.canvas.flush_events()plot_obj = plotting_class()for i in range(20):    plot_obj.plotting(i)    time.sleep(1) # just to see the additions to the plot    if i ==1:        plt.show()
 
Categories:
  • Martin Dráb Profile Picture
    Martin Dráb 222,562 Super User on at
    Dynamically plotting data real time quickly
    Is this really something related to Microsoft Dynamics 365? If so, which D365 app are you using and what you're doing there with Matplotlib?
     
    I suspect you came to a wrong site by mistake.

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,030 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,562 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans