@@ -223,7 +223,7 @@ end subroutine initialize
223
223
!
224
224
! Add an x,y plot.
225
225
226
- subroutine add_plot (me , x , y , label , linestyle , markersize , linewidth , xlim , ylim )
226
+ subroutine add_plot (me , x , y , label , linestyle , markersize , linewidth , xlim , ylim , xscale , yscale )
227
227
228
228
class(pyplot), intent (inout ) :: me ! ! pyplot handler
229
229
real (wp), dimension (:), intent (in ) :: x ! ! x values
@@ -234,6 +234,8 @@ subroutine add_plot(me, x, y, label, linestyle, markersize, linewidth, xlim, yli
234
234
integer , intent (in ), optional :: linewidth ! ! width of the plot line
235
235
real (wp),dimension (2 ), intent (in ), optional :: xlim ! ! x-axis range
236
236
real (wp),dimension (2 ), intent (in ), optional :: ylim ! ! y-axis range
237
+ character (len=* ), intent (in ), optional :: xscale ! ! example: 'linear' (default), 'log'
238
+ character (len=* ), intent (in ), optional :: yscale ! ! example: 'linear' (default), 'log'
237
239
238
240
character (len= :), allocatable :: xstr ! ! x values stringified
239
241
character (len= :), allocatable :: ystr ! ! y values stringified
@@ -276,6 +278,10 @@ subroutine add_plot(me, x, y, label, linestyle, markersize, linewidth, xlim, yli
276
278
if (allocated (xlimstr)) call me% add_str(' ax.set_xlim(' // xlimstr// ' )' )
277
279
if (allocated (ylimstr)) call me% add_str(' ax.set_ylim(' // ylimstr// ' )' )
278
280
281
+ ! axis scales:
282
+ if (present (xscale)) call me% add_str(' ax.set_xscale("' // xscale// ' ")' )
283
+ if (present (yscale)) call me% add_str(' ax.set_yscale("' // yscale// ' ")' )
284
+
279
285
call me% add_str(' ' )
280
286
281
287
else
@@ -427,7 +433,7 @@ end subroutine add_3d_plot
427
433
!
428
434
! Add a bar plot.
429
435
430
- subroutine add_bar (me , left , height , label , width , bottom , color , yerr , align , xlim , ylim )
436
+ subroutine add_bar (me , left , height , label , width , bottom , color , yerr , align , xlim , ylim , xscale , yscale )
431
437
432
438
class(pyplot), intent (inout ) :: me ! ! pyplot handler
433
439
real (wp), dimension (:), intent (in ) :: left ! ! left bar values
@@ -440,6 +446,8 @@ subroutine add_bar(me, left, height, label, width, bottom, color, yerr, align, x
440
446
character (len=* ), intent (in ), optional :: align ! ! default: 'center'
441
447
real (wp),dimension (2 ), intent (in ), optional :: xlim ! ! x-axis range
442
448
real (wp),dimension (2 ), intent (in ), optional :: ylim ! ! y-axis range
449
+ character (len=* ), intent (in ), optional :: xscale ! ! example: 'linear' (default), 'log'
450
+ character (len=* ), intent (in ), optional :: yscale ! ! example: 'linear' (default), 'log'
443
451
444
452
character (len= :), allocatable :: xstr ! ! x axis values stringified
445
453
character (len= :), allocatable :: ystr ! ! y axis values stringified
@@ -494,6 +502,10 @@ subroutine add_bar(me, left, height, label, width, bottom, color, yerr, align, x
494
502
if (allocated (xlimstr)) call me% add_str(' ax.set_xlim(' // xlimstr// ' )' )
495
503
if (allocated (ylimstr)) call me% add_str(' ax.set_ylim(' // ylimstr// ' )' )
496
504
505
+ ! axis scales:
506
+ if (present (xscale)) call me% add_str(' ax.set_xscale("' // xscale// ' ")' )
507
+ if (present (yscale)) call me% add_str(' ax.set_yscale("' // yscale// ' ")' )
508
+
497
509
call me% add_str(' ' )
498
510
499
511
else
0 commit comments