Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RDF] Support bar charts in RDataFrame for Alphanumeric Bins #17721

Closed
wants to merge 5 commits into from

Conversation

Aditya-138-12
Copy link
Contributor

This Pull request:

Add new RBarChart class and MakeBarChartTH1D method to RDataFrame to support visualization of categorical string data as bar charts.

Changes or fixes:

  • Automatically handles bin labeling
  • Supports string-based categories
  • Returns manipulable TH1D histogram

Example Usage

In ROOT CLI

auto df = ROOT::RDataFrame(10);
auto df2 = df.Define("Category", []() { 
    std::vector<std::string> categories = {"A", "B", "C", "A", "B"}; 
    return categories[rand() % 5]; 
});

auto barChart = df2.MakeBarChartTH1D("Category", "test_chart", "Test Categories");

barChart.GetHistogram()->Draw("HIST");

Checklist:

  • [✅] tested changes locally
  • [✅] updated the docs (if necessary)

This PR fixes #17057

Add new RBarChart class and MakeBarChartTH1D method to RDataFrame
to support visualization of categorical string data as bar charts.
- Automatically handles bin labeling
- Supports string-based categories
- Returns manipulable TH1D histogram
@Aditya-138-12
Copy link
Contributor Author

Hi @vepadulano, I have messed up with this PR due to some merges, I will open up a new one.
Thank you for your support!!

@Aditya-138-12 Aditya-138-12 deleted the issue_17057 branch March 20, 2025 08:21
@Aditya-138-12 Aditya-138-12 restored the issue_17057 branch March 20, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RDF] support bar charts in RDataFrame
2 participants