Ask Your Question

Can I scatter plot shaded grids?

asked 2015-12-01 07:57:45 -0500

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 09:59:29 -0500

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 12:17:02 -0500 )edit

That's awesome!

kcrisman gravatar imagekcrisman ( 2015-12-01 20:28:13 -0500 )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 07:57:45 -0500

Seen: 91 times

Last updated: Dec 01 '15