Ask Your Question
1

Scatter Plot is not visible using notebook

asked 2018-08-22 19:38:48 +0100

yasar11732 gravatar image

I am using following commands to create a scatter plot in SageMath notebook;

from sage.plot.scatter_plot import ScatterPlot
x = ScatterPlot(range(2, 100000), [len(divisors(x)) for x in range(2, 100000)], {'facecolor':'white', 'marker':'s'})
show(x)

However, only thing I am getting is this output;

πš‚πšŒπšŠπšπšπšŽπš› πš™πš•πš˜πš πšπš›πšŠπš™πš‘πš’πšŒπšœ πš™πš›πš’πš–πš’πšπš’πšŸπšŽ πš˜πš— 𝟿𝟿𝟿𝟿𝟾 𝚍𝚊𝚝𝚊 πš™πš˜πš’πš—πšπšœ.

How can I show a scatter plot using SageMath?

edit retag flag offensive close merge delete

1 Answer

Sort by Β» oldest newest most voted
3

answered 2018-08-22 20:51:05 +0100

slelievre gravatar image

Instead of using ScatterPlot, which is a helper class, use scatter_plot as follows.

sage: x = scatter_plot([(x, len(divisors(x))) for x in range(2, 100000)], facecolor='white', marker='s')
sage: x
Launched png viewer for Graphics object consisting of 1 graphics primitive

Or you could use Sage's plot2d as follows:

sage: x = point2d(((x, len(divisors(x))) for x in range(2, 100000)))
sage: x
Launched png viewer for Graphics object consisting of 1 graphics primitive
edit flag offensive delete link more

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

Stats

Asked: 2018-08-22 19:38:48 +0100

Seen: 549 times

Last updated: Aug 22 '18