def METHOD_NAME(ax, polygon):
    from sfepy.postprocess.plot_dofs import _get_axes
    dim = polygon.shape[1]
    ax = _get_axes(ax, dim)
    pp = nm.r_[polygon, polygon[:1]]
    px, py = pp[:, 0], pp[:, 1]
    if dim == 2:
        ax.plot(px, py)
    else:
        pz = pp[:, 2]
        ax.plot(px, py, pz)
    return ax