next up previous
Next: Stacked Bar Graph Up: Plotting Capabilities Previous: Plotting Capabilities


Simple Multicolumn Plot

This example shows how a bunch of columns against a common (x-axis) column can be plotted in case there is a matrix of data to be analyzed. This is probably the simplest form of graph that can be plotted on Matlab or any other plotting tool like GNUplot [7]. A brief discussion of the script follows the code snippet.

% log2mul, LogMaxN, maxM, SetPrec, IntgrPrec, GotPrec, 4 times, TotalTime %

A=[
18,1522,172,1000,760,722,0.268435,5.100274,0.268435,0.000000,6.174016
18,1884,216,1250,933,895,0.536871,5.905580,0.805306,0.000000,7.784628
18,2268,264,1500,1117,1077,1.073742,6.979322,1.610613,0.000000,10.200547
18,2651,312,1750,1298,1261,1.073742,8.321499,2.684355,0.000000,12.884902
18,3016,360,2000,1475,1435,1.879048,9.126805,4.294967,0.000000,16.106127
18,3399,408,2250,1650,1618,2.415919,10.200547,6.979322,0.000000,20.401094
18,3761,456,2500,1822,1791,2.952790,11.274289,10.200547,0.000000,25.501368
18,4145,508,2750,2005,1974,3.758096,12.616467,15.032386,0.000000,32.480690
18,4528,554,3000,2166,2157,5.100274,13.421773,20.401094,0.000000,39.996883
18,4893,600,3250,2325,2325,5.637145,14.227079,27.648851,0.000000,48.855251
18,5276,646,3500,2483,2482,6.710886,15.569257,37.849400,0.000000,61.471718
18,5639,692,3750,2639,2638,8.321499,16.642998,46.976204,0.000000,73.551315
18,6022,738,4000,2793,2793,9.932112,17.448305,59.324234,0.000000,88.852135
];

maxtimeX = 600:10:2462;
maxtimeY=60;
bestX=2462;
bestY=0:1:60;

plot(A(:,6), A(:,7), 'm-+', A(:,6), A(:,8), 'g-+', A(:,6), A(:,9), 'b-+', A(:,6), A(:,11), 'r-+', maxtimeX, maxtimeY , 'k--', bestX, bestY, 'k');

legend('Precision Achieved (vs) Time for Log n computation', 'Precision Achieved (vs) Time for Harmonic Series computation','Precision Achieved (vs) Time for Bernouli Term computation', 'Precision Achieved (vs) Total Time');
title('Precision (vs) Various Times', 'FontWeight', 'bold');
xlabel('Precision Acheived');
ylabel('Time (in seconds) [Max permissible = 60]'); 
axis([700 2900 0 100]);
Figure 8: Simple Multicolumn Plot
\begin{figure}\epsfig{file=src/vs10004000_18_new_times.eps, width=13cm}
\end{figure}


next up previous
Next: Stacked Bar Graph Up: Plotting Capabilities Previous: Plotting Capabilities
Arvind Gopu 2006-03-24