-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhistogram_example.f90
More file actions
33 lines (28 loc) · 871 Bytes
/
Copy pathhistogram_example.f90
File metadata and controls
33 lines (28 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
program example
use iso_fortran_env
use fplot_core
implicit none
! Local Variables
integer(int32), parameter :: n = 5000
integer(int32), parameter :: nbins = 30
real(real64) :: x(n), u(n), v(n)
type(plot_2d) :: plt
type(plot_data_histogram) :: pd1
class(plot_axis), pointer :: xAxis
! Initialization
call plt%initialize()
xAxis => plt%get_x_axis()
! Create some data
call random_number(u)
call random_number(v)
v = v - 1.0d0
x = u * u - v * v
! Rotate the labels on the x axis
call xAxis%set_tic_label_angle(90.0)
call xAxis%set_tic_label_rotation_origin(GNUPLOT_ROTATION_ORIGIN_RIGHT)
! Plot the data
call pd1%set_bin_count(nbins) ! optional, but must be done prior to define_data is used
call pd1%define_data(x)
call plt%push(pd1)
call plt%draw()
end program