Hi all,
Thanks for the replies, but I have already tried that, and I get a return value of 0 when the axis clearly starts at -6:
http://www.onlineclienttest.co.uk/plot.png
The histogram was filled with successive calls to SetBinContent, rather than calls to Fill - would this impact the behavior of this call? The histogram is created in the following function:
// CreateDeltaHist
TH1F* CreateDeltaHist(TH1F *hist1, TH1F *hist2, string name)
{
Int_t nBins = hist1->GetNbinsX();
Double_t lowVal = hist1->GetBinLowEdge(1);
Double_t highVal = hist1->GetBinLowEdge(nBins) + hist1-
>GetBinWidth(nBins);
TH1F *delta = new TH1F(name.c_str(), "", nBins, lowVal, highVal); Double_t x, y, xErr, yErr, diff, diffErr; for(Int_t i = 1; i <= hist1->GetNbinsX(); ++i) {
x = hist1->GetBinContent(i); y = hist2->GetBinContent(i); xErr = hist1->GetBinError(i); yErr = hist2->GetBinError(i); diff = (x - y) * 100.0; diffErr = <long line snipped>; delta->SetBinContent(i, diff); delta->SetBinError(i, diffErr);
and displayed with the following code snippet:
// Create delta hist
TH1F *deltaHist = CreateDeltaHist(alMass, boMass, "boaldiff"); deltaHist->GetYaxis()->SetTitle("#\delta (\%/5 GeV)"); deltaHist->GetXaxis()->SetTitle("M_{e^{+}e^{-}} (GeV/c^{2})");
// Display mass histograms
TCanvas *c1 = new TCanvas("c1", "imposed", 700, 400);
deltaHist->SetMarkerStyle(7); deltaHist->SetMarkerSize(1); deltaHist->SetMarkerColor(kBlue); deltaHist->SetLineColor(kBlue); deltaHist->Draw("HIST");
Where the final call is printing "min: 0"
Any ideas?
Regards,
James.
On 11 Nov 2007, at 20:38, Ahsan, Mahsana wrote:
> Hi James,
>
>
>
>
> >
>
>
>
>
>
>
This archive was generated by hypermail 2.2.0 : Mon Nov 12 2007 - 05:50:02 CET