TH1F *hist = new TH1F("hist", "Histogram", 100, 0, 100); hist->Fill(20); hist->Fill(30); hist->Fill(40); hist->SetMarkerStyle(22); hist->Draw();
TH1F *hist = new TH1F("hist", "Histogram", 100, 0, 100); hist->Fill(20); hist->Fill(30); hist->Fill(40); hist->SetMarkerStyle(20); hist->SetMarkerColor(kRed); hist->Draw("SAME");In this example, a histogram is created with 100 bins ranging from 0 to 100. Data points are then added to the histogram and the marker style is set to a circle marker with SetMarkerStyle(20) and the color is set to red with SetMarkerColor(kRed). The histogram is then drawn on the same canvas with an existing histogram. Package/Library: ROOT framework library.