#include "rootlogon.h"

#include <TF1.h>
#include <TGraphErrors.h>
#include <TH1F.h>
#include <TCanvas.h>
#include <TRandom.h>
#include <TGaxis.h>

int main()
{
	rootlogon();

	const double x[] = { 1, 4 };
	const double y[] = { 0.46, 2.11 };
	const double ex[] = { 0, 0 };
	const double ey[] = { 0.3, 0.3 };
	TGraphErrors* graph = new TGraphErrors(2, x, y, NULL, ey);
	graph->SetTitle("");

	TCanvas* cnv = new TCanvas;
	//cnv->SetMargin(0.15, 0.9, 0.20, 0.9);
	cnv->DrawFrame(0, 0, 4.5, 2.5);
	graph->Draw("P*");
	graph->GetXaxis()->SetRangeUser(-1,4.5);

	TLine* line = new TLine(0,0,4.5,2.25);
	line->SetLineColor(kBlue);
	line->Draw("same");

	cnv->SaveAs("out/linregerr.eps");
}
