Error bars

Hi.

I am trying to add error bars to a graph. However the errors are very small and the resulting graph has all error bars of the same length and in some cases misses them out completely. Is there a way to increase the scale of the y-axis to increase the size of the bars?
the following data is the x axis, y axis and y errors:
350 0.07 0.0001
355 0.08 0.0001
360 0.08 0.0001
365 0.1 0.0001
370 0.11 0.0001
375 0.13 0.0002
380 0.15 0.0002
385 0.19 0.0002
390 0.26 0.0002
395 0.36 0.0002
400 0.49 0.0001
405 0.63 0.0001
410 0.76 0.0003
415 0.84 0.0002
420 0.89 0.0003
425 0.9 0.0002
430 0.91 0.0000
435 0.9 0.0002
440 0.91 0.0002
445 0.91 0.0002
450 0.91 0.0002
455 0.91 0.0002
460 0.91 0.0001
465 0.91 0.0003
470 0.91 0.0002
475 0.92 0.0001
480 0.92 0.0001
485 0.92 0.0003
490 0.92 0.0003
495 0.92 0.0002
500 0.92 0.0001
505 0.92 0.0001
510 0.92 0.0001
515 0.92 0.0001
520 0.91 0.0001
525 0.91 0.0002
530 0.91 0.0002
535 0.91 0.0002
540 0.91 0.0001
545 0.91 0.0001
550 0.91 0.0001
555 0.91 0.0001
560 0.91 0.0001
565 0.91 0.0001
570 0.91 0.0001
575 0.91 0.0001
580 0.91 0.0001
585 0.91 0.0001
590 0.91 0.0001
595 0.91 0.0002
600 0.9 0.0002
605 0.91 0.0002
610 0.9 0.0001
615 0.9 0.0001
620 0.9 0.0000
625 0.9 0.0001
630 0.9 0.0001
635 0.9 0.0002
640 0.9 0.0005
645 0.9 0.0009
650 0.89 0.0005
655 0.9 0.0004
660 0.89 0.0002
665 0.89 0.0001
670 0.89 0.0001
675 0.89 0.0001
680 0.89 0.0000
685 0.89 0.0001
690 0.89 0.0001
695 0.89 0.0001
700 0.89 0.0001
errors.C (1.27 KB)

Firsy, you have an error in your program.
Replace the statement:

TGraph* inputSpec = new TGraph(n, x, y); //change for title as necessary
inputSpec = new TGraphErrors(n, x, y, ey);
by
TGraphErrors *inputSpec = new TGraphErrors(n, x, y, 0,ey);

It is normal that you do not see the errors (1e-4 compared to 1).

Note that you can reduce you 50 lines script simply to:

{ TGraphErrors *inputSpec = new TGraphErrors("errors.dat","%lg %lg %lg"); inputSpec->SetTitle("Reflectance of Correx"); inputSpec->GetXaxis()->SetTitle("Wavelength (nm)"); inputSpec->GetYaxis()->SetTitle("Spectral Reflectance"); inputSpec->Draw("ALP"); }

Rene