drawnow

Draw now and Matplotlib

瘦欲@ 提交于 2021-01-28 00:27:07
问题 I am currently working on a project that involves taking analog readings, and mapping them real time on a graph. So to complete this I am running a photo resister through an Arduino Analog port and am reading that data via python 3.4.3. On the python side I have maplotlib, and drawnow installed. The code as it is shown below will plot the first data marker that the resistor will read, but will not update it real time. However if I change the resistance and then restart the program it will

How to speed up a very slow animated plot in MATLAB

倾然丶 夕夏残阳落幕 提交于 2019-12-13 01:04:00
问题 I'm trying to create an animated plot but my code is very slow, perhaps the method I'm using is too naive. In the below example, I have 4 subplots each with 3 lines, which I update in a 'time' loop. clc;clear;close all; state = {'$x-Position$','$x-Velocity$','$y-Position$','$y-Velocity$'}; ylabels = {'$x$','$\dot{x}$','$y$','$\dot{y}$'}; options1 = {'interpreter','latex'}; options2 = {'interpreter','latex','fontsize',20}; maxT = 300; for pp = 1:4 hh1(pp)=subplot(2,2,pp); xlabel('$t$',options2