Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include<windows.graphics.display.

h>
#include <stdio.h>
#include <conio.h>

void XPLOT( float s[], int n, int stepX, float stepY,int Xpos,int Ypos,int color)
{
int i, x, y;

/*
char c[20];
setcolor(4);
setlinestyle( DOTTED_LINE, 1, NORM_WIDTH );
line(2, Ypos, 512, Ypos);//Draw x-axis

for(i=1; i<=10; i++){//Mark on x-axis


x=2+(50*i);
line(x, Ypos-5, x, Ypos+5);
sprintf(c, "%-3.0f", i*50.);
outtextxy(x, Ypos-13, c);
x=2+(50*(i-1));
line(x, Ypos-5, x, Ypos+5);
sprintf(c, "%-3.0f", (i-1)*50.);
outtextxy(x, Ypos-13, c);
}
*/

setcolor( color );
setlinestyle( SOLID_LINE, 1, NORM_WIDTH );
x=Xpos;
y=(int)(Ypos+s[0]*stepY);
moveto(x,y);

for(i=1;i<n;i++){
x=Xpos+i*stepX;
y=Ypos+(int)(s[i]*stepY);
lineto(x, y);
}
}

You might also like