Suzan Cioc
Suzan Cioc

Reputation: 30127

How to draw anything in Sage?

I took an example from here http://wiki.sagemath.org/pics, entered it, but nothing happened:

enter image description here

Why?

Upvotes: 1

Views: 56

Answers (1)

kcrisman
kcrisman

Reputation: 4402

This is just a really time-consuming graphics to create! The many plot points is one reason, not the only one - it took me several minutes to see output just from the first 10 iterations. Presumably why it was uploaded as a picture. If you change it from (1,20) to (1,5) you can start to see the beginnings of this. Or, you can just skip the for loop and do

f = lambda x: sum([sin(x*3^i)/(2^i) for i in range(1,10)])
plot(f,0,float(pi/3),plot_points=2000).show()

and wait for that one.

The moral of the story is that everywhere continuous, nowhere differentiable functions are really hard to visualize!

Upvotes: 2

Related Questions