Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It should be. That's a bug.

In fact, it's the first thing on the list at Ticket #11225.

It probably wouldn't even be that hard to fix. The problem is that setup_for_eval_on_grid wants to use fast_float but Piecewise guys don't have that.

It should be. That's a bug.

In fact, it's the first thing on the list at Ticket #11225.

It probably wouldn't even be that hard to fix. The problem is that setup_for_eval_on_grid wants to use fast_float but Piecewise guys don't have that.

Edit to answer the question about a workaround:

Just make two separate plots and add them! It's fun and easy, I never cease to be thankful for this functionality...

sage: f = Piecewise([[(-2,1),1],[(1,4),x]])
sage: g =  Piecewise([[(-2,1),1],[(1,4),2*x]])
sage: P = plot(f,color='green')
sage: Q = plot(g,linestyle='--')
sage: P+Q