TH1F *hist = new TH1F("hist", "Example Histogram", 50, 0, 100); hist->Fill(20); hist->Fill(30); hist->Fill(40); hist->Fill(50); hist->SetMarkerSize(1.5); hist->Draw();
#includeIn this example, we create a new ROOT file and histogram. Then we fill the histogram with some data. We set the marker size to 1.5 and write the histogram to the file. Finally, we close the file. In conclusion, the SetMarkerSize method is a useful feature of the TH1F class in the ROOT framework.#include #include using namespace std; int main() { TFile *file = new TFile("data.root", "RECREATE"); TH1F *hist = new TH1F("hist", "Example Histogram", 50, 0, 100); hist->Fill(20); hist->Fill(30); hist->Fill(40); hist->Fill(50); hist->SetMarkerSize(1.5); hist->Write(); file->Close(); return 0; }