ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 31 Aug 2014 15:42:47 +0200Single pixel marks in a scatter_plothttps://ask.sagemath.org/question/24014/single-pixel-marks-in-a-scatter_plot/I'd like to create a scatter plot of some data and ensure that every data point colors exactly one pixel of the result, its position simply rounded to nearest neighbor without any antialiasing. However, the `marker=","` setting in the `scatter_plot` invocation doesn't have the effect the manual description “(pixel)” suggests. Is there some additional setting required to achieve this, or perhaps some other approach altogether?
Example (related to [this post](http://math.stackexchange.com/a/914871/35416) about how to recreate [this image](http://mathoverflow.net/a/178264/25563)):
import itertools
def genpos(limit = 100):
r = range(limit)
for m in r:
dm = m*m
if dm > limit: break
for n in r:
dn = dm + n*n
if dn > limit: break
for p in r:
dp = dn + p*p
if dp > limit: break
for q in r:
d = dp + q*q
if d > limit: break
if d == 0: continue
abc = [m*m + n*n - p*p - q*q, 2*(m*q + n*p), 2*(n*q - m*p)]
abc = map(abs, abc)
for i in itertools.permutations(abc, 2):
yield (i[0]/d, i[1]/d)
scatter_plot(list(genpos(100)), markersize=1, marker=",", aspect_ratio=1)MvGSun, 31 Aug 2014 15:42:47 +0200https://ask.sagemath.org/question/24014/