Ask Your Question
1

Scatter Plot is not visible using notebook

asked 6 years ago

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?

Preview: (hide)

1 Answer

Sort by Β» oldest newest most voted
3

answered 6 years ago

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
Preview: (hide)
link

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: 6 years ago

Seen: 577 times

Last updated: Aug 22 '18