-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Feature Request: Histogram Plotting Support
Description
Add support for histogram plotting to visualize frequency distributions of data. This is one of the most fundamental statistical plot types missing from fortplotlib.
Proposed API
call fig%hist(data, bins=10, label='Data distribution')
call fig%hist(data, bins=[0.0, 1.0, 2.0, 5.0, 10.0]) \! Custom bin edges
call fig%hist(data, bins=20, density=.true.) \! Probability densityRequirements
- Support for automatic binning (specify number of bins)
- Support for custom bin edges
- Optional density normalization
- Integration with existing color/label/legend system
- Support for all backends (PNG, PDF, ASCII)
Implementation Notes
- Should follow matplotlib's
hist()API where possible - Need efficient binning algorithm for large datasets
- Consider cumulative histogram option
- Handle edge cases (empty data, single value, etc.)
Test Requirements
- Comprehensive test coverage required
- Test automatic binning with various bin counts
- Test custom bin edges (uniform and non-uniform)
- Test density normalization
- Test edge cases (empty data, single value, identical values)
- Test integration with labels and legends
- Test all backends (PNG, PDF, ASCII)
Example Requirements
- Simple, clear example required
- Demonstrate basic histogram usage
- Show custom binning options
- Include multiple datasets with different colors
- Generate output in all supported formats
- Add to
example/directory ashistogram_demo.f90
Related
This addresses one of the core statistical plot types identified as missing. Histograms are fundamental for:
- Data exploration and analysis
- Frequency distribution visualization
- Statistical modeling and validation
- Scientific data analysis workflows
Acceptance Criteria
- Implementation follows SOLID principles
- Comprehensive test suite with >90% coverage
- Working example demonstrating key features
- Documentation updated
- All backends supported
- Performance acceptable for datasets up to 10^6 points
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request