plt.gray dont' work with plt.scatter?

Hello, Sorry for my broken english. I copy the source code from

http://matplotlib.sourceforge.net/examples/pylab_examples/scatter_demo.html

Just Insert one line “gray()” before the last line “show()”.

But the picture is sitll colorful. not a gray picture.

It there somethig I missed. Thanks in advance.

bar.py (393 Bytes)

gray() sets the default colormap for raster-based plot commands like imshow(), matshow() and figimage(). For scatter(), you need to set the colors of plot elements invidually. Setting the facecolor in the scatter() command will work for the example you tried:

scatter(x,y,s=area, marker='^', facecolor=(.7,.7,.7), c='r')

Gary R.

lotrpy wrote:

···

Hello, Sorry for my broken english. I copy the source code from
http://matplotlib.sourceforge.net/examples/pylab_examples/scatter_demo.html
Just Insert one line "gray()" before the last line "show()".
But the picture is sitll colorful. not a gray picture.
It there somethig I missed. Thanks in advance.

Thanks, work like a charm.

···

On Sat, Sep 12, 2009 at 4:06 PM, Gary Ruben <gruben@…636…> wrote:

gray() sets the default colormap for raster-based plot commands like imshow(), matshow() and figimage(). For scatter(), you need to set the colors of plot elements invidually. Setting the facecolor in the scatter() command will work for the example you tried:

scatter(x,y,s=area, marker=‘^’, facecolor=(.7,.7,.7), c=‘r’)

Gary R.

lotrpy wrote:

Hello, Sorry for my broken english. I copy the source code from
http://matplotlib.sourceforge.net/examples/pylab_examples/scatter_demo.html

Just Insert one line “gray()” before the last line “show()”.
But the picture is sitll colorful. not a gray picture.
It there somethig I missed. Thanks in advance.