home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1996 February
/
PCWK0296.iso
/
sharewar
/
os2
/
grafika
/
splot
/
demo
/
errorbar.spt
< prev
next >
Wrap
Text File
|
1994-07-07
|
1KB
|
44 lines
#include <splot.h>
/* This example file illustrates the use of errorbars and straight */
/* line fits to data. It also uses a small internal data array rather */
/* than reading data in from a file */
double data[4][4] = {
1.2, 0.24, 0.1, 1,
2.0, 0.43, 0.1, 1,
4.0, 0.52, 0.1, 1,
6.0, 0.87, 0.1, 1};
double yint,slope;
main()
{
set(LINEWIDTH,0.1);
set(PLOTTYPE,SYMBOLS);
axes_box(12,15,0,0,8,1.0);
tickmarks();
set(FONTWIDTH,0.5);
ticklabel();
set(FONTWIDTH,0.7);
label(BOTTOM,"SiGe Well Width in (nm)");
label(LEFT,"Biexciton Lifetime in (!m!s)");
text(10.03,22.56,"MBE SiGe Quantum Wells",CENTER);
/* draw the data points */
drawdata(data,0,1);
/* put in the error bars for the x values */
errorbars(XVALS,data,0,1,3);
/* put in the error bars for the y values */
errorbars(YVALS,data,0,1,2);
/* fit the best line to the data and return the slope and intercept */
fitline(data,0,1,&yint,&slope);
print(slope);
print(yint);
}