Plotting multiple graphs in a single window by using matlab

brainReader

I'm trying to make matlab record live data from muse headset and I'm successful to plot accelerometer data and voltage v/s time data in a single window. if I try to add new graph for the same window, then the new graph will overlap with the existing code.

Here is a part of code which deals with plotting of graphs.

subplot(2,1,1);
         time = 0:1/fse:secBuffer-1/fse;
         h1 = plot(time,eegBuffer);
         legend(eegName, 'Location','EastOutside');
         xlabel('Time (s)')
         ylabel('Voltage (uV)')        

         subplot(2,1,2);
         time = 0:1/fsa:secBuffer-1/fsa;
         h2= plot(time,accBuffer);
         xlabel('Time (s)')
         ylabel('Acceleration (mG)')
         legend(h2, accName, 'Location','EastOutside');

         subplot(2,1,3);
         final = eegBuffer*5;
         h3 = plot(final,eegBuffer);
         xlabel('final')
         ylabel('eegbuffer')
         %legend(h2, accName, 'Location','EastOutside');

         plot1 = false;

        else
         cell1 = (num2cell(eegBuffer,1))';
         set(h1,{'ydata'},cell1);
         cell2 = (num2cell(accBuffer,1))';
         set(h2,{'ydata'},cell2);
         cell3 = (num2cell(final,1))'; 
         set(h3,{'ydata'},cell3);  

And here is the screen shot:
screen shot

Ander Biguri

You are using subplot(2,1,X). If you read the documentation, the first two numbers are rows and colums of the "plot matrix", therefore, you are defining a plot matrix of 2x1=2 subplots.

If you want to plot 3 things you should change the subplot lines to:

subplot(2,2,1)  

subplot(2,2,2)

subplot(2,2,3)  % or subplot(2,2,3:4) for even more fancy ploting

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Plotting multiple graphs depending on column value with gnuplot

分類Dev

Plotting multiple lines on a single graph using Shiny and ggplot2

分類Dev

Using pmap in ggplot2 to automate plotting graphs of different datasets

分類Dev

R: Plotting with ggplot using multiple lines

分類Dev

Plotting multiple bars into a chart using MatPlotLib

分類Dev

Plotting three data sets on a single plot using matplotlib

分類Dev

Can a single Nautilus window be started with multiple tabs?

分類Dev

Smoothing multiple columns with Hann window - MATLAB

分類Dev

plotting eigenvector in Matlab

分類Dev

MATLAB Plotting Error with symbols

分類Dev

Plotting the solution of diffusion equation for multiple times using SciPy

分類Dev

Plotting multiple 3d lines in one figure using plotly

分類Dev

Multiple graphs with r

分類Dev

Matlab: Accessing images from multiple folders in single loop

分類Dev

Plotting multiple lines in Tableau

分類Dev

Plotting multiple lines in Tableau

分類Dev

Plotting time vector with date Matlab

分類Dev

Efficiently using multiple docker containers in a single host

分類Dev

Using a single DLL for multiple projects requiring it

分類Dev

MyBatis multiple data sources using single mapper

分類Dev

Using Multiple Function to get an output in a single Line

分類Dev

Plotting two graphs, one below the other, in shiny panel

分類Dev

injecting the d3.js graphs correctly when using Angular directive multiple times with bootstrap

分類Dev

Multiple graphs on the same plot in seaborn

分類Dev

How to create periodic matrix using single vector in matlab?

分類Dev

Realtime plotting using matplotlib

分類Dev

How to draw multiple triangles with different sizes and directions based on data using plotting tools like Matplotlib

分類Dev

Plotting multiple polylines on Google Maps

分類Dev

matlab simple plotting with microseconds time vector

Related 関連記事

  1. 1

    Plotting multiple graphs depending on column value with gnuplot

  2. 2

    Plotting multiple lines on a single graph using Shiny and ggplot2

  3. 3

    Using pmap in ggplot2 to automate plotting graphs of different datasets

  4. 4

    R: Plotting with ggplot using multiple lines

  5. 5

    Plotting multiple bars into a chart using MatPlotLib

  6. 6

    Plotting three data sets on a single plot using matplotlib

  7. 7

    Can a single Nautilus window be started with multiple tabs?

  8. 8

    Smoothing multiple columns with Hann window - MATLAB

  9. 9

    plotting eigenvector in Matlab

  10. 10

    MATLAB Plotting Error with symbols

  11. 11

    Plotting the solution of diffusion equation for multiple times using SciPy

  12. 12

    Plotting multiple 3d lines in one figure using plotly

  13. 13

    Multiple graphs with r

  14. 14

    Matlab: Accessing images from multiple folders in single loop

  15. 15

    Plotting multiple lines in Tableau

  16. 16

    Plotting multiple lines in Tableau

  17. 17

    Plotting time vector with date Matlab

  18. 18

    Efficiently using multiple docker containers in a single host

  19. 19

    Using a single DLL for multiple projects requiring it

  20. 20

    MyBatis multiple data sources using single mapper

  21. 21

    Using Multiple Function to get an output in a single Line

  22. 22

    Plotting two graphs, one below the other, in shiny panel

  23. 23

    injecting the d3.js graphs correctly when using Angular directive multiple times with bootstrap

  24. 24

    Multiple graphs on the same plot in seaborn

  25. 25

    How to create periodic matrix using single vector in matlab?

  26. 26

    Realtime plotting using matplotlib

  27. 27

    How to draw multiple triangles with different sizes and directions based on data using plotting tools like Matplotlib

  28. 28

    Plotting multiple polylines on Google Maps

  29. 29

    matlab simple plotting with microseconds time vector

ホットタグ

アーカイブ