@@ -309,24 +309,25 @@ end subroutine add_plot
309
309
subroutine add_hist (me , x , label , xlim , ylim , xscale , yscale , bins , normed , cumulative )
310
310
311
311
class(pyplot), intent (inout ) :: me ! ! pyplot handler
312
- real (wp), dimension (:), intent (in ) :: x ! ! x values
312
+ real (wp), dimension (:), intent (in ) :: x ! ! array of data
313
313
character (len=* ), intent (in ) :: label ! ! plot label
314
314
real (wp),dimension (2 ), intent (in ), optional :: xlim ! ! x-axis range
315
315
real (wp),dimension (2 ), intent (in ), optional :: ylim ! ! y-axis range
316
316
character (len=* ), intent (in ), optional :: xscale ! ! example: 'linear' (default), 'log'
317
317
character (len=* ), intent (in ), optional :: yscale ! ! example: 'linear' (default), 'log'
318
- integer , intent (in ), optional :: bins ! !
319
- logical , intent (in ), optional :: normed
320
- logical , intent (in ), optional :: cumulative
318
+ integer , intent (in ), optional :: bins ! ! number of bins
319
+ logical , intent (in ), optional :: normed ! ! boolean flag that determines whether bin counts are normalized
320
+ logical , intent (in ), optional :: cumulative ! ! boolean flag that determines whether histogram represents the cumulative density of dataset
321
+
322
+ character (len= :), allocatable :: xstr ! ! x values stringified
323
+ character (len= :), allocatable :: xlimstr ! ! xlim values stringified
324
+ character (len= :), allocatable :: ylimstr ! ! ylim values stringified
325
+ character (len=* ), parameter :: xname = ' x' ! ! x variable name for script
326
+ character (len= :), allocatable :: extras ! ! optional stuff
327
+ character (len= 5 ) :: normedstr= ' ' ! !
328
+ character (len= 5 ) :: cumulativestr= ' ' ! !
329
+ character (len= max_int_len) :: binsstr ! !
321
330
322
- character (len= :), allocatable :: xstr ! ! x values stringified
323
- character (len= :), allocatable :: xlimstr ! ! xlim values stringified
324
- character (len= :), allocatable :: ylimstr ! ! ylim values stringified
325
- character (len= max_int_len) :: binsstr ! !
326
- character (len=* ), parameter :: xname = ' x' ! ! x variable name for script
327
- character (len= :), allocatable :: extras ! ! optional stuff
328
- character (len= 5 ) :: normedstr= ' '
329
- character (len= 5 ) :: cumulativestr= ' '
330
331
331
332
if (allocated (me% str)) then
332
333
@@ -367,13 +368,6 @@ subroutine add_hist(me, x, label, xlim, ylim, xscale, yscale, bins, normed, cumu
367
368
' cumulative=' // trim (cumulativestr)// ' ,' // &
368
369
' normed=' // trim (normedstr)// ' )' )
369
370
370
- ! write the plot statement:
371
- ! call me%add_str('CS = ax.'//contourfunc//'('//xname_//','//yname_//','//zname_//','//&
372
- ! 'label="'//trim(label)//'",'//&
373
- ! 'linestyles="'//trim(adjustl(linestyle))//'"'//&
374
- ! extras//')')
375
-
376
-
377
371
! axis limits:
378
372
if (allocated (xlimstr)) call me% add_str(' ax.set_xlim(' // xlimstr// ' )' )
379
373
if (allocated (ylimstr)) call me% add_str(' ax.set_ylim(' // ylimstr// ' )' )
0 commit comments