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


Dual Axes Example

This example shows how Matlab can be used to plot a common column (x-axis) not only against two different columns (in the y-axis) but also when they are at different scales i.e. the two columns to plot against the common x-axis are in different ranges altogether. As usual, a brief discussion of the script follows the code snippet.

% log2mul, LogMaxN, maxM, SetPrec, IntgrPrec, GotPrec, 4 times, TotalTime %   
A=[
18,2203,256,3460,1087,1048,0.536871,7.247757,1.610613,0.000000,9.663676
18,2410,280,3460,1178,1146,0.805306,7.516193,1.879048,0.000000,10.737418
...
18,6567,640,3460,2462,2462,12.616467,19.058918,44.560287,0.000000,81.067505
];

X1=[
1.0
1.1
...
3.0
];

X2=[
A(1,4)*1.0
A(1,4)*1.1
...
A(1,4)*3.0
]

bestX = 2.37;
bestY = 1000:10:3000;   

[haxes, hline1, hline2] =  plotyy(X1(:,1), A(:,6), X1(:,1), A(:,11), 'plot', 'plot');

axes(haxes(1));  
ylabel('Precision achieved');
hold on
plot (bestX, bestY, 'r')
hold off

axes(haxes(2));
ylabel('Computation Time (in seconds)');
xlabel('Precision Multiplier [Working Precision = precision * precision multiplier]');
title('Working Precision (vs) Precision achieved/Computation Time', 'FontWeight', 'Bold');
Figure 10: Dual Axes Example
\begin{figure}\epsfig{file=src/vs_2462_precmul.eps, width=13cm}
\end{figure}


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