Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: 3 Y axes wih 4 variable
Replies: 9   Last Post: Apr 24, 2013 9:28 AM

 Messages: [ Previous | Next ]
 Murat Posts: 7 Registered: 4/20/13
Re: 3 Y axes wih 4 variable
Posted: Apr 23, 2013 12:18 PM

i got some progress in my programme. now i have a question ; how can i get the curves smooth in this codes? ;

c = [0.008 0.009 0.01 0.01179 0.013 0.015 0.02 0.025 0.03 0.0362 0.04 0.045] ;
h0 = [0.0048 0.00495 0.0049 0.00495 0.00481 0.0048 0.0048 0.00475 0.0042 0.00398 0.004 0.00405];
Q = [1275 1501.9 1725 2100 2388.8 2840.6 3975 5081.3 6198.8 7602 8445 9686];
Qs = [701.25 901.14 1069.5 1491 1767.712 2244.074 3418.5 4522.357 5640.908 7069.86 7938.3 9201.7];
f = [0.00453 0.0042 0.0037 0.0035 0.00325 0.003 0.003 0.0024 0.0022 0.00211 0.00213 0.0021];

%# Some initial computations:
axesPosition = [200 40 1000 500]; %# Axes position, in pixels
yWidth = 30; %# y axes spacing, in pixels
xLimit = [min(c) max(c)]; %# Range of x values
xOffset = -yWidth*diff(xLimit)/axesPosition(3);

%# Create the figure and axes:
figure('Units','pixels','Position',[300 300 750 750]);
h1 = axes('Units','pixels','Position',axesPosition,...
'Color','w','XColor','k','YColor','r',...
h2 = axes('Units','pixels','Position',axesPosition+yWidth.*[-1.25 0 1 0],...
'Color','none','XColor','k','YColor','c',...
'XLim',xLimit+[1.25*xOffset 0],...
'XTick',[],'XTickLabel',[],...
h3 = axes('Units','pixels','Position',axesPosition+yWidth.*[-2.5 0 2 0],...
'Color','none','XColor','k','YColor','g',...
'XLim',xLimit+[2.5*xOffset 0],...
xlabel(h1,'time');
ylabel(h3,'values');

%# Plot the data:
plot(h1,c,h0,'r');
plot(h2,c,Q,'c');
plot(h2,c,Qs,'b');
plot(h3,c,f,'g')

%'XAxisLocation','bottom',...
%'YAxisLocation','left',...

Date Subject Author
4/20/13 Murat
4/20/13 dpb
4/21/13 Murat
4/23/13 Murat
4/23/13 Murat
4/23/13 dpb
4/23/13 Murat
4/24/13 dpb
4/24/13 Murat
4/24/13 dpb