@@ -39,6 +39,7 @@ module pyplot_module
39
39
logical :: show_legend = .false. ! ! show legend into plot
40
40
logical :: use_numpy = .true. ! ! use numpy python module
41
41
logical :: mplot3d = .false. ! ! it is a 3d plot
42
+ logical :: polar = .false. ! ! it is a polar plot
42
43
logical :: axis_equal = .false. ! ! equal scale on each axis
43
44
44
45
contains
@@ -99,7 +100,7 @@ end subroutine add_str
99
100
100
101
subroutine initialize (me , grid , xlabel , ylabel , zlabel , title , legend , use_numpy , figsize , &
101
102
font_size , axes_labelsize , xtick_labelsize , ytick_labelsize , ztick_labelsize , &
102
- legend_fontsize , mplot3d , axis_equal )
103
+ legend_fontsize , mplot3d , axis_equal , polar )
103
104
104
105
class(pyplot), intent (inout ) :: me ! ! pyplot handler
105
106
logical , intent (in ), optional :: grid ! ! activate grid drawing
@@ -116,8 +117,9 @@ subroutine initialize(me, grid, xlabel, ylabel, zlabel, title, legend, use_numpy
116
117
integer , intent (in ), optional :: ytick_labelsize ! ! size of y axis tick lables
117
118
integer , intent (in ), optional :: ztick_labelsize ! ! size of z axis tick lables
118
119
integer , intent (in ), optional :: legend_fontsize ! ! size of legend font
119
- logical , intent (in ), optional :: mplot3d ! ! set true for 3d plots
120
+ logical , intent (in ), optional :: mplot3d ! ! set true for 3d plots (cannot use with polar)
120
121
logical , intent (in ), optional :: axis_equal ! ! set true for axis = 'equal'
122
+ logical , intent (in ), optional :: polar ! ! set true for polar plots (cannot use with mplot3d)
121
123
122
124
character (len= max_int_len) :: width_str ! ! figure width dummy string
123
125
character (len= max_int_len) :: height_str ! ! figure height dummy string
@@ -150,6 +152,11 @@ subroutine initialize(me, grid, xlabel, ylabel, zlabel, title, legend, use_numpy
150
152
else
151
153
me% mplot3d = .false.
152
154
end if
155
+ if (present (polar)) then
156
+ me% polar = polar
157
+ else
158
+ me% polar = .false.
159
+ end if
153
160
if (present (axis_equal)) then
154
161
me% axis_equal = axis_equal
155
162
else
@@ -191,6 +198,8 @@ subroutine initialize(me, grid, xlabel, ylabel, zlabel, title, legend, use_numpy
191
198
192
199
if (me% mplot3d) then
193
200
call me% add_str(' ax = fig.gca(projection='' 3d'' )' )
201
+ elseif (me% polar) then
202
+ call me% add_str(' ax = fig.gca(projection='' polar'' )' )
194
203
else
195
204
call me% add_str(' ax = fig.gca()' )
196
205
end if
0 commit comments