Drawing a histogram without connecting lines

UPDATE: I was able to solve it
hist->SetMarkerStyle(2);
hist->Draw(“P”);


Hello All

I am trying to draw a 1D histogram with just points (without any lines or impulse points). From the root manual I see that TH1->Draw("*H") should do that. However, in addition to the points, I still get lines. How do I fix this?

I would like to keep just the points and get rid of the blue lines shown below.

What I get with hist->Draw("*H"):

What I would like to get (drawn using gnuplot) :

Thanks
Victor

 hpx->SetMarkerStyle(3)
 hpx->Draw("P")

Thanks.

I am trying to draw a solid fit for the fit and a scatter plot for the data.
However, when I draw the histogram with hpx->Draw(“P”), my fit disappears in the plot as shown below:

	TCanvas *canoldtof = new TCanvas("canoldtof","canoldtof",600,400); 
	gStyle->SetOptFit(1011);
	gStyle->SetStatStyle(0); // transparent
	hpx->GetXaxis()->SetTitle("Timing");
	hpx->SetMarkerStyle(7);
	hpx->SetTitle(Histtitle);
	hpx->Draw("P");
	hpx->Fit("gaus","WIQ","P");
	FitFunc = hpx->GetFunction("gaus");						// get the function
	FitFunc->SetLineColor(kRed); FitFunc->SetLineWidth(1);
	Fit_Sigma    = FitFunc->GetParameter(2);	

	TPaveText *fitlabel = new TPaveText(0.15,0.8,0.35,0.9,"NDC");
	fitlabel->SetFillColor(42);
	char text[400];
	sprintf(text,"FWHM=%7.2f",Fit_Sigma*2.3548);
	fitlabel->AddText(text);
	fitlabel->Draw("same");
	canoldtof->Update();
	char imagefilename[FILENAME_MAX]; sprintf(imagefilename,"%s/hist.png",CurrentDir);
	canoldtof->SaveAs(imagefilename);

[quote=“couet”] hpx->SetMarkerStyle(3) hpx->Draw("P") [/quote]

do not draw the hitogram. just do:

hpx->SetMarkerStyle(3)
hpx->Fit("gaus","","P")


Thanks. I did that and still get just the points without the connecting line for the fit. Here is the segment of code I am using:

TCanvas *canoldtof = new TCanvas("canoldtof","canoldtof",600,400); hpx->SetMarkerStyle(7); hpx->Fit("gaus","WIQ","P"); char imagefilename[FILENAME_MAX]; sprintf(imagefilename,"%s/resolution.png",CurrentDir); canoldtof->SaveAs(imagefilename);

ROOT Version: 5.26/00 14 December 2009

More information:
As part of a compiled code I do not get the connecting lines.
g++ root-config --cflags --libs test.C -o test

However if I save the histogram in the code (hpx->SaveAs(“hpx.C”);), and then invoke root via command line, I get the points for the histogram and the connecting line for the fit - just as I want.

root [1] .x hpx.C root [2] c1->Clear(); root [3] hpx->SetMarkerStyle(7); root [4] hpx->Fit("gaus","WIQ","P");

Can you send a smal program reproducing the problem ? something we can compile and run ?