C Language Program used to create liner.htm
Code Shown as Exported in HTML format from Notepad++
Using the NPP Export Plugin

//svg file maker #include <math.h> #include <stdlib.h> #include <stdio.h> FILE * mybuffer; void sline(float x1,float y1,float x2,float y2); void srectangle(float x1,float y1,float x2,float y2); void sellipse(float x1,float y1,float rx,float ry); void stext(float x1,float y1,float ang,char * stext); void sfill(float x1,float y1); void sfillc(int r,int g,int b);int sfr=200,sfg=200,sfb=255; void sbackc(int r,int g,int b);int sbr=255,sbg=255,sbb=255; void strokc(int r,int g,int b);int ssr=0,ssg=0,ssb=0; void svgopen(float sx1,float sy1);float sx=70,sy=70; void svgclose(void); void svgscale(float x1,float y1,float x2,float y2); float sxmin=0,sxmax=100,symin=0,symax=100; float scalex(float); float scaley(float); int main(int argc, char **argv) { int s; float x,y,xo,yo; char nums[200]; svgopen(700,500); svgscale(-30.0,-30.0,250.0,230.0); //sline(0,0,200,200); //Draw a line you will never see srectangle(0,0,200,200); //Draw graph box char m[]="Exponential Decay";stext(65,210,0,m); //Graph Title char n[]="Time (seconds)";stext(65,-20,0,n); //x-axis legend char o[]="Percent";stext(-15,70,-90,o); //y-axis legend //Draw tic marks and units for (s=20;s<200;s+=20){sline(0,s,5,s);sline(200,s,195,s);sline(s,0,s,5);sline(s,200,s,195);} for (s=40;s<200;s+=40) {sprintf(nums,"%d",s/2);stext(-10,s,0,nums);sprintf(nums,"%d",s);stext(s,-10,0,nums);} //Draw data and connecting lines sfillc(255,0,0); for (x=5;x<200;x+=18) {y=200.*exp(-x/50.);if (x>6.0){sline(x,y,xo,yo);} xo=x;yo=y;} for (x=5;x<200;x+=18) {y=200.*exp(-x/50.);sellipse(x,y,3,4);} svgclose(); return(0);} void svgopen(float sx1,float sy1){ sx=sx1;sy=sy1; mybuffer=fopen("liner1.htm","w"); fprintf(mybuffer,"<!DOCTYPE html>"); fprintf(mybuffer,"<html><body><center><h1>Plot of Exponential Decay Using SVG</h1><hr>\n"); fprintf(mybuffer, "<svg width='%.1f' height='%.1f' xmlns='http://www.w3.org/2000/svg' version='1.1'>\n",sx,sy);} void sline(float x1,float y1,float x2,float y2){ x1=scalex(x1);y1=scaley(y1);x2=scalex(x2); y2=scaley(y2); fprintf(mybuffer, "<line x1='%.0f' y1='%.0f' x2='%.0f' y2='%.0f' style='stroke:rgb(%d,%d,%d);stroke-width:2'/>\n",x1,y1,x2,y2,ssr,ssg,ssb);} void srectangle(float x1,float y1,float x2,float y2){ x1=scalex(x1);y1=scaley(y1);x2=scalex(x2); y2=scaley(y2); fprintf(mybuffer,"<rect x='%.1f' y='%.1f' width='%.1f' height='%.1f' style='fill:rgb(%d,%d,%d);stroke-width:1;stroke:rgb(%d,%d,%d)'/>\n", x1,y2,(x2-x1),fabs(y2-y1),sfr,sfg,sfb,ssr,ssg,ssb);} void sellipse(float x1,float y1,float rx,float ry){ x1=scalex(x1);y1=scaley(y1); ry=ry/(symax-symin)*sy;rx=rx/(sxmax-sxmin)*sx; fprintf(mybuffer,"<ellipse cx='%.1f' cy='%.1f' rx='%.1f' ry='%.1f' style='fill:rgb(%d,%d,%d);stroke-width:1;stroke:rgb(%d,%d,%d)' />\n", x1,y1,rx,ry,sfr,sfg,sfb,ssr,ssg,ssb); } void stext(float x1,float y1,float ang, char * stext){ x1=scalex(x1);y1=scaley(y1); fprintf(mybuffer,"<text x='%.1f' y='%.1f' fill=rgb(%d,%d,%d) transform='rotate(%.1f %.1f %.1f)'>%s</text>\n", x1,y1,ssr,ssg,ssb,ang,x1,y1,stext); } void sfillc(int r,int g,int b){ sfr=r;sfg=g;sfb=b;} void sbackc(int r,int g,int b){ sbr=r;sbg=g;sbb=b;} void strokc(int r,int g,int b){ ssr=r;ssg=g;ssb=b;} void svgclose(void){ fprintf(mybuffer, "</svg></center></body></html>\n"); fclose(mybuffer); system ("/usr/bin/firefox liner.htm");} void svgscale(float x1,float y1,float x2,float y2){ sxmin=x1;sxmax=x2;symin=y1;symax=y2;} float scalex(float x){ return (x-sxmin)/(sxmax-sxmin)*sx;} float scaley(float y){ return -(y-symin)/(symax-symin)*sy+sy;}





==thats all folks===