Drawing filled circles (discs)

sidimok <sidimok@...287...> writes:

Well, let's take the one you've proposed the last time. How than can i put a
colorbar beside the plot?

Add in the imports

from matplotlib.colorbar import ColorbarBase, make_axes

and change the myscatter function to

def myscatter(ax, colormap, x, y, radii, colors):
    for x1,y1,r,c in zip(x, y, radii, colormap(colors)):
        ax.add_patch(Circle((x1,y1), r, fc=c))
    cax, _ = make_axes(ax)
    ColorbarBase(cax, cmap=colormap)

A better solution is probably to implement a CircleCollection similarly
to the other collections.


Jouni K. Sepp�nen