Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Unanswered

Dynamically plotting data real time quickly

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 225,864 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

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,584 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,864 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans