- Download and install gnuplot: http://www.gnuplot.info
- Creat a file data.txt:
Time TX RX Total
1 0.00% 0.95% 0.95%
2 0.00% 1.03% 1.03%
3 0.09% 0.83% 0.92%
4 0.09% 1.09% 1.17%
5 0.00% 0.69% 0.69%
6 0.09% 1.07% 1.16%
7 0.00% 1.02% 1.02%
8 0.09% 1.15% 1.25%
9 0.09% 0.85% 0.94%
10 0.00% 0.92% 0.92%
11 0.18% 0.98% 1.16%
12 0.18% 1.19% 1.37%
13 0.18% 1.36% 1.54%
14 0.23% 1.30% 1.52%
15 0.00% 0.89% 0.89%
16 0.09% 1.17% 1.26%
17 0.09% 1.26% 1.35%
18 0.00% 1.13% 1.13%
19 0.18% 1.28% 1.46%
20 0.09% 0.84% 0.93%
- Run in gnuplot>
set xlabel 'Time (s)'
set ylabel 'Duty Cycle (%)'
set yrange [0:2]
set xrange [1:20]
set key autotitle columnheader
plot "data.txt" u 1:2 w linespoints lt -1 pt 5 dt 5, '' u 1:3 w linespoints lt -1 pt 4 dt 2, '' u 1:4 w linespoints lt -1 pt 3
- Output
Showing posts with label plot. Show all posts
Showing posts with label plot. Show all posts
Friday, February 13, 2015
Thursday, December 20, 2012
Quick Start: Graph with Matlab
Prepare data in file ttidata.m
1 157 1851 (separated by TAB)
2 203 1864
3 250 1866
4 281 1869
5 313 2187
6 344 2713
7 359 2716
8 375 2942
9 406 3039
10 453 3301
2 203 1864
3 250 1866
4 281 1869
5 313 2187
6 344 2713
7 359 2716
8 375 2942
9 406 3039
10 453 3301
Draw (x, y) and (x, z) graphs on the same canvas
load ttidata.m
y = ttidata(:,2);
z = ttidata(:,3);
plot([1:length(y)],y,'g-x')
hold on
plot([1:length(z)],z,'g-x')
y = ttidata(:,2);
z = ttidata(:,3);
plot([1:length(y)],y,'g-x')
hold on
plot([1:length(z)],z,'g-x')
Subscribe to:
Posts (Atom)