The error message is correct -- you should not expect to be able to plot this function, because it is only defined for integer values of x, not all x between 2 and 4. For example:
sage: f1(2.1) <snip> TypeError: 'sage.rings.real_mpfr.RealLiteral' object cannot be interpreted as an integer On Tuesday, January 21, 2025 at 11:47:26 PM UTC-7 Georgi Guninski wrote: > sage: def f1(x): return sum(i for i in range(x)) > sage: f1(20) > 190 > sage: pl1=plot(f1,2,4);pl1 > verbose 0 (3965: plot.py, generate_plot_points) WARNING: When > plotting, failed to evaluate function at 200 points. > verbose 0 (3965: plot.py, generate_plot_points) Last error message: > ''float' object cannot be interpreted as an integer' > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/sage-devel/4a44a281-f702-4ef0-b71f-969de7216ca2n%40googlegroups.com.