Zorder for grid is not working for polar plot in matplotlib

Viewed 66

I am making a pizza plot and this is the output of my code:

enter image description here

I am using the below code to make the dotted circle appear below the straight black lines but it's not working:

# set up line for each bar
ax.set_thetagrids((theta+width/2)* 180 / np.pi)

# for other circles
for i in list(ax.yaxis.get_gridlines())[:-1]:
  i.set_color("#808080")
  i.set_linewidth(2)
  i.set_linestyle("--")
  i.set_zorder(2)         # this seems to not work
        
# for straight-line
for i in list(ax.xaxis.get_gridlines()):
  i.set_color("#000000")
  i.set_linewidth(2)
  i.set_linestyle('-')
  i.set_zorder(3)         # this seems to not work

How to set-up the zorder for these two things?

0 Answers
Related