Ask Your Question

Can I scatter plot shaded grids?

asked 2015-12-01 14:57:45 +0200

ctennenh gravatar image

I would like to make a scatter plot, much like those in and regarding Wythoff's Game. Right now my best approximation is using scatter_plot and gridlines='minor', but it's not quite what I'm looking for. Does anyone know if it's possible in Sage?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-12-01 16:59:29 +0200

kcrisman gravatar image

You'll want to use a combination of matrix_plot and scatter_plot/points. matrix_plot should accept a number of different colormaps, you'll want to just enter two values in your matrix to get just two colors (default is greyscale, I believe, so white and black). Good luck!

edit flag offensive delete link more


Thanks Karl-Dieter! I have the following spitting out black and white spaces. I've been trying to figure out how to use subdivisions to get horizontal and vertical lines to differentiate neighboring squares of the same color, but am coming up blank.

M=[[1 for x in range(6)] for x in range(6)] 
for L in T:

Is there a way to get lines? Gridlines only puts the lines through the centers of each square.

Edit: I think I have it. I added the following line:


and included subdivisions=True in matrix_plot.

ctennenh gravatar imagectennenh ( 2015-12-01 19:17:02 +0200 )edit

That's awesome!

kcrisman gravatar imagekcrisman ( 2015-12-02 03:28:13 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-12-01 14:57:45 +0200

Seen: 328 times

Last updated: Dec 01 '15