Skip to content

Commit 1c98108

Browse files
committed
changed left argument to add_bar to "x" to avoid depreciation warning for latest matplotlib
1 parent 744000d commit 1c98108

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/pyplot_module.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -676,11 +676,11 @@ end subroutine add_sphere
676676
!
677677
! Add a bar plot.
678678

679-
subroutine add_bar(me, left, height, label, width, bottom, color, &
679+
subroutine add_bar(me, x, height, label, width, bottom, color, &
680680
yerr, align, xlim, ylim, xscale, yscale, istat)
681681

682682
class(pyplot), intent(inout) :: me !! pyplot handler
683-
real(wp), dimension(:), intent(in) :: left !! left bar values
683+
real(wp), dimension(:), intent(in) :: x !! x bar values
684684
real(wp), dimension(:), intent(in) :: height !! height bar values
685685
character(len=*), intent(in) :: label !! plot label
686686
real(wp), dimension(:), intent(in), optional :: width !! width values
@@ -717,7 +717,7 @@ subroutine add_bar(me, left, height, label, width, bottom, color, &
717717
if (present(ylim)) call vec_to_string(ylim, me%real_fmt, ylimstr, me%use_numpy)
718718

719719
!convert the arrays to strings:
720-
call vec_to_string(left, me%real_fmt, xstr, me%use_numpy)
720+
call vec_to_string(x, me%real_fmt, xstr, me%use_numpy)
721721
call vec_to_string(height, me%real_fmt, ystr, me%use_numpy)
722722
if (present(width)) call vec_to_string(width, me%real_fmt, wstr, me%use_numpy)
723723
if (present(bottom)) call vec_to_string(bottom, me%real_fmt, bstr, me%use_numpy)
@@ -733,7 +733,7 @@ subroutine add_bar(me, left, height, label, width, bottom, color, &
733733

734734
!create the plot string:
735735
plt_str = 'ax.bar('//&
736-
'left='//trim(xname)//','//&
736+
'x='//trim(xname)//','//&
737737
'height='//trim(yname)//','
738738
if (present(yerr)) plt_str=plt_str//'yerr='//trim(yerrname)//','
739739
if (present(width)) plt_str=plt_str//'width='//trim(wname)//','

src/tests/test.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ program test
6464
xtick_labelsize = 20,&
6565
ytick_labelsize = 20,&
6666
legend_fontsize = 20 )
67-
call plt%add_bar(left=x,height=sx,width=tx,label='$\sin (x)$',&
67+
call plt%add_bar(x=x,height=sx,width=tx,label='$\sin (x)$',&
6868
color='r',yerr=yerr,xlim=[0.0_wp, 20.0_wp],align='center',istat=istat)
6969
call plt%savefig('bartest.png', pyfile='bartest.py',istat=istat)
7070

0 commit comments

Comments
 (0)