Skip to content

Commit 744000d

Browse files
committed
fixed bug for filled contour plot.
1 parent e502558 commit 744000d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pyplot_module.f90

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ subroutine add_contour(me, x, y, z, label, linestyle, linewidth, levels, color,
467467
character(len=*), parameter :: zname_ = 'Z' !! Z variable name for contour
468468
character(len=:), allocatable :: extras !! optional stuff
469469
character(len=:), allocatable :: contourfunc !! 'contour' or 'contourf'
470+
logical :: is_filled !! if it is a filled contour plot
470471

471472
if (allocated(me%str)) then
472473

@@ -500,7 +501,9 @@ subroutine add_contour(me, x, y, z, label, linestyle, linewidth, levels, color,
500501

501502
!filled or regular:
502503
contourfunc = 'contour' !default
504+
is_filled = .false.
503505
if (present(filled)) then
506+
is_filled = filled
504507
if (filled) contourfunc = 'contourf' !filled contour
505508
end if
506509

@@ -514,7 +517,7 @@ subroutine add_contour(me, x, y, z, label, linestyle, linewidth, levels, color,
514517
if (colorbar) call me%add_str('fig.colorbar(CS)')
515518
end if
516519

517-
call me%add_str('ax.clabel(CS, fontsize=9, inline=1)')
520+
if (.not. is_filled) call me%add_str('ax.clabel(CS, fontsize=9, inline=1)')
518521
call me%add_str('')
519522

520523
else

0 commit comments

Comments
 (0)