我想在一个N乘M的网格上画出不同颜色和相同大小的圆。在x,y位置,可以是一个圆或什么都不是。在
我希望每个专栏都有一个x标签(这将是一个星期),和一个ylabel(这将是一个主题)。在
现在,我找到了一种使用子图绘制圆的方法,但是我无法获得文本和网格。在
下面是我画圆圈的代码:import matplotlib.pyplot as plt
from matplotlib.patches import Wedge
from plotly.graph_objs import *
from matplotlib.gridspec import GridSpec
def dual_half_circle(center, radius, angle=0, ax=None, colors=('w','k'), **kwargs):
"""
Add two half circles to the axes *ax* (or the current axes) with the
specified facecolors *colors* rotated at *angle* (in degrees).
"""
if ax is None:
ax = plt.gca()
kwargs.update(transform=ax.transAxes, clip_on=False)
theta1, theta2 = angle, angle + 180
w1 = Wedge(center, radius, theta1, theta2, fc=colors[0], **kwargs)
w2 = Wedge(center, radius, theta2, theta1, fc=colors[1], **kwargs)
for wedge in [w1, w2]:
ax.add_artist(wedge)
return [w1, w2]
以下是显示所有内容的代码(我删除了颜色条件):
^{pr2}$
这是结果,我没有注释,也没有网格
我是否应该从副情节改为经典情节,以便能够添加我想要的内容?
谢谢你的帮助!在