Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4d02635
fix: Support NaN values for disconnected line segments
krystophny Jul 20, 2025
34f9636
test: Improve coverage for NaN line breaking
krystophny Jul 20, 2025
86ba82c
test: Comprehensive NaN line breaking coverage
krystophny Jul 20, 2025
6e468ce
fix: Correct array indexing in disconnected_lines example
krystophny Jul 20, 2025
957a741
feat: Add histogram plotting support with TDD
krystophny Jul 20, 2025
d2391c1
fix: Break long lines in fortplot_figure module
krystophny Jul 20, 2025
177208f
fix: Address code review feedback for histogram implementation
krystophny Jul 20, 2025
a75432c
fix: Update histogram demo to use FORD-compatible output directory an…
krystophny Jul 21, 2025
3d1fe8d
fix: refactor histogram routines for SOLID compliance and eliminate m…
krystophny Aug 16, 2025
58648dd
fix: Correct dependency name in fpm example
krystophny Aug 16, 2025
12cdbd8
fix: refactor remaining histogram routines for 30-line SOLID compliance
krystophny Aug 16, 2025
647f807
feat: expose histogram in main fortplot API for matplotlib compatibility
krystophny Aug 16, 2025
81e72a2
fix: refactor hist subroutine for SOLID compliance
krystophny Aug 16, 2025
b87d1b8
fix: address critical security and quality findings
krystophny Aug 16, 2025
7378999
docs: mark histogram feature as implemented in README
krystophny Aug 16, 2025
fffb5ac
fix: prevent segmentation faults in histogram with invalid bins param…
krystophny Aug 16, 2025
2208056
fix: update repository references from krystophny/fortplotlib to lazy…
krystophny Aug 17, 2025
5066b03
fix: remove binary files and build artifacts from workspace
krystophny Aug 17, 2025
80d4958
Merge main branch - resolve conflicts between histogram and boxplot f…
krystophny Aug 17, 2025
e6321d4
fix: update CMake example to use correct fortplot target names
krystophny Aug 17, 2025
401af92
fix: correct test executable name in CI and improve histogram plot in…
krystophny Aug 17, 2025
783c725
fix: move histogram test files from app/ to test/ directory for prope…
krystophny Aug 17, 2025
6c7cfd8
fix: resolve segmentation fault in global pyplot-style histogram func…
krystophny Aug 17, 2025
4779ddb
fix: correct output paths in boxplot and grid examples
krystophny Aug 17, 2025
f7c067d
merge: integrate main branch updates into histogram branch
krystophny Aug 18, 2025
3a72285
fix: resolve histogram allocation error in merged implementation
krystophny Aug 18, 2025
a836321
docs: clean up issue references in README
krystophny Aug 18, 2025
a5bb9f3
chore: remove obsolete CMake files
krystophny Aug 18, 2025
ac3f4e4
fix: critical array bounds violation in histogram tick calculation
krystophny Aug 18, 2025
4f35119
fix: eliminate critical allocation errors in histogram functionality
krystophny Aug 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 0 additions & 81 deletions CMakeLists.txt

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ to build and run them.

**Optional:**
- `ffmpeg` - Required for saving animations in compressed video formats (MP4, AVI, MKV)
- **5-Layer Validation**: Comprehensive framework prevents false positives (Issue #32)
- **5-Layer Validation**: Comprehensive framework prevents false positives
- **External validation**: FFprobe integration for format verification
- **Documentation**: See [MPEG Validation Guide](doc/mpeg_validation.md) for details

Expand Down Expand Up @@ -204,7 +204,7 @@ pip install git+https://github.com/lazy-fortran/fortplot.git
- [x] Interactive display with `show()` (GUI detection for X11, Wayland, macOS, Windows)
- [x] Animation support with `FuncAnimation` (requires `ffmpeg` for video formats)
- **5-Layer Validation**: Comprehensive framework with size, header, semantic, and external tool checks
- **False Positive Prevention**: Solves Issue #32 with multi-criteria validation
- **False Positive Prevention**: Multi-criteria validation framework
- [x] Unicode and LaTeX-style Greek letters (`\alpha`, `\beta`, `\gamma`, etc.) in all backends
- [ ] Subplots
- [ ] Annotations
Expand Down
44 changes: 0 additions & 44 deletions doc/cmake_example/CMakeLists.txt

This file was deleted.

8 changes: 4 additions & 4 deletions example/fortran/boxplot_demo.f90.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ program boxplot_demo
call fig%set_xlabel('Data Groups')
call fig%set_ylabel('Values')
call fig%boxplot(normal_data, label='Normal Distribution')
call fig%savefig('plots/boxplot_single.png')
call fig%savefig('build/example/boxplot_demo/boxplot_single.png')
print *, 'Created boxplot_single.png'

! Box plot with outliers
Expand All @@ -39,7 +39,7 @@ program boxplot_demo
call fig%set_xlabel('Data Groups')
call fig%set_ylabel('Values')
call fig%boxplot(outlier_data, label='Data with Outliers')
call fig%savefig('plots/boxplot_outliers.png')
call fig%savefig('build/example/boxplot_demo/boxplot_outliers.png')
print *, 'Created boxplot_outliers.png'

! Multiple box plots for comparison
Expand All @@ -51,7 +51,7 @@ program boxplot_demo
call fig%boxplot(group_b, position=2.0_wp, label='Group B')
call fig%boxplot(group_c, position=3.0_wp, label='Group C')
call fig%legend()
call fig%savefig('plots/boxplot_comparison.png')
call fig%savefig('build/example/boxplot_demo/boxplot_comparison.png')
print *, 'Created boxplot_comparison.png'

! Horizontal box plot
Expand All @@ -60,7 +60,7 @@ program boxplot_demo
call fig%set_xlabel('Values')
call fig%set_ylabel('Data Groups')
call fig%boxplot(normal_data, horizontal=.true., label='Horizontal')
call fig%savefig('plots/boxplot_horizontal.png')
call fig%savefig('build/example/boxplot_demo/boxplot_horizontal.png')
print *, 'Created boxplot_horizontal.png'

print *, 'Box plot demonstration completed!'
Expand Down
14 changes: 7 additions & 7 deletions example/fortran/grid_demo.f90.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ program grid_demo
call fig%set_title('Basic Grid Lines')
call fig%set_xlabel('Time (s)')
call fig%set_ylabel('Amplitude')
call fig%savefig('plots/grid_basic.png')
call fig%savefig('build/example/grid_demo/grid_basic.png')
write(*,*) 'Created grid_basic.png'

! Basic plot with default grid (PDF)
Expand All @@ -38,7 +38,7 @@ program grid_demo
call fig%set_title('Basic Grid Lines')
call fig%set_xlabel('Time (s)')
call fig%set_ylabel('Amplitude')
call fig%savefig('plots/grid_basic.pdf')
call fig%savefig('build/example/grid_demo/grid_basic.pdf')
write(*,*) 'Created grid_basic.pdf'

! Grid with custom transparency
Expand All @@ -50,7 +50,7 @@ program grid_demo
call fig%set_title('Grid with Custom Transparency (alpha=0.6)')
call fig%set_xlabel('Time (s)')
call fig%set_ylabel('Amplitude')
call fig%savefig('plots/grid_custom_alpha.png')
call fig%savefig('build/example/grid_demo/grid_custom_alpha.png')
write(*,*) 'Created grid_custom_alpha.png'

! Grid with custom line style
Expand All @@ -62,7 +62,7 @@ program grid_demo
call fig%set_title('Grid with Dashed Lines')
call fig%set_xlabel('Time (s)')
call fig%set_ylabel('Amplitude')
call fig%savefig('plots/grid_dashed.png')
call fig%savefig('build/example/grid_demo/grid_dashed.png')
write(*,*) 'Created grid_dashed.png'

! X-axis grid only
Expand All @@ -74,7 +74,7 @@ program grid_demo
call fig%set_title('X-Axis Grid Lines Only')
call fig%set_xlabel('Time (s)')
call fig%set_ylabel('Amplitude')
call fig%savefig('plots/grid_x_only.png')
call fig%savefig('build/example/grid_demo/grid_x_only.png')
write(*,*) 'Created grid_x_only.png'

! Y-axis grid only
Expand All @@ -86,7 +86,7 @@ program grid_demo
call fig%set_title('Y-Axis Grid Lines Only')
call fig%set_xlabel('Time (s)')
call fig%set_ylabel('Amplitude')
call fig%savefig('plots/grid_y_only.png')
call fig%savefig('build/example/grid_demo/grid_y_only.png')
write(*,*) 'Created grid_y_only.png'

! Minor grid lines
Expand All @@ -98,7 +98,7 @@ program grid_demo
call fig%set_title('Minor Grid Lines')
call fig%set_xlabel('Time (s)')
call fig%set_ylabel('Amplitude')
call fig%savefig('plots/grid_minor.png')
call fig%savefig('build/example/grid_demo/grid_minor.png')
write(*,*) 'Created grid_minor.png'

write(*,*) 'Grid lines demonstration completed!'
Expand Down
66 changes: 66 additions & 0 deletions example/fortran/histogram_demo.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
program histogram_demo
!! Example demonstrating histogram plotting capabilities
!! Shows basic histogram, custom bins, and density normalization

use, intrinsic :: iso_fortran_env, only: wp => real64
use fortplot
implicit none

integer, parameter :: n_data = 1000
real(wp) :: data(n_data), normal_data(n_data)
type(figure_t) :: fig
integer :: i
real(wp) :: pi = 3.14159265359_wp

! Generate random-like data (simple distribution)
do i = 1, n_data
data(i) = real(i, wp) / 100.0_wp + sin(real(i, wp) * 0.01_wp) * 5.0_wp
end do

! Generate normal-like data using Box-Muller transform approximation
do i = 1, n_data
normal_data(i) = cos(2.0_wp * pi * real(i, wp) / real(n_data, wp)) * &
sqrt(-2.0_wp * log(max(real(mod(i, 1000), wp) / 1000.0_wp, 0.001_wp)))
end do

! Basic histogram
call fig%initialize(800, 600)
call fig%hist(data)
call fig%set_title('Basic Histogram Example')
call fig%set_xlabel('Value')
call fig%set_ylabel('Frequency')
call fig%savefig('build/example/histogram_demo/histogram_basic.png')
write(*,*) 'Created histogram_basic.png'

! Custom bins histogram
call fig%initialize(800, 600)
call fig%hist(data, bins=20)
call fig%set_title('Histogram with 20 Bins')
call fig%set_xlabel('Value')
call fig%set_ylabel('Frequency')
call fig%savefig('build/example/histogram_demo/histogram_custom_bins.png')
write(*,*) 'Created histogram_custom_bins.png'

! Density histogram
call fig%initialize(800, 600)
call fig%hist(normal_data, bins=15, density=.true.)
call fig%set_title('Normalized Histogram (Density)')
call fig%set_xlabel('Value')
call fig%set_ylabel('Probability Density')
call fig%savefig('build/example/histogram_demo/histogram_density.png')
write(*,*) 'Created histogram_density.png'

! Multiple histograms with labels
call fig%initialize(800, 600)
call fig%hist(data(1:500), bins=15, label='Dataset 1', color=[0.0_wp, 0.447_wp, 0.698_wp])
call fig%hist(normal_data(1:500), bins=15, label='Dataset 2', color=[0.835_wp, 0.369_wp, 0.0_wp])
call fig%legend()
call fig%set_title('Multiple Histograms')
call fig%set_xlabel('Value')
call fig%set_ylabel('Frequency')
call fig%savefig('build/example/histogram_demo/histogram_multiple.png')
write(*,*) 'Created histogram_multiple.png'

write(*,*) 'Histogram demonstration completed!'

end program histogram_demo
8 changes: 2 additions & 6 deletions src/fortplot.f90
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,7 @@ subroutine hist(data, bins, density, label, color)
real(8), intent(in), optional :: color(3)

call ensure_global_figure_initialized()
! TODO: Implement hist method in figure_core
! call fig%hist(data, bins=bins, density=density, label=label, color=color)
call log_error("hist() not yet implemented - please use main branch for histogram support")
call fig%hist(data, bins=bins, density=density, label=label, color=color)
end subroutine hist

subroutine histogram(data, bins, density, label, color)
Expand All @@ -258,9 +256,7 @@ subroutine histogram(data, bins, density, label, color)
real(8), intent(in), optional :: color(3)

call ensure_global_figure_initialized()
! TODO: Implement hist method in figure_core
! call fig%hist(data, bins=bins, density=density, label=label, color=color)
call log_error("hist() not yet implemented - please use main branch for histogram support")
call fig%hist(data, bins=bins, density=density, label=label, color=color)
end subroutine histogram

subroutine boxplot(data, position, width, label, show_outliers, horizontal, color)
Expand Down
Loading
Loading