Using max and plot
I want to plot a function such as x mapsto max(x,1). How do I do that?
I want to plot a function such as x mapsto max(x,1). How do I do that?
Try this using max_symbolic
. It won't do as much as you might like, but you can plot it, at least.
Edit - didn't have time to include the code earlier:
plot(max_symbolic(x,1),(x,-5,5),ymin=0)
Thank you very much for your help. This does what I want.
Try using a lambda function.
This works for me:
sage: plot(lambda x: max(x, 1), (-5, 5), ymin=0)
Thank you, too. I really appreciate your help. This also does what I want.
Asked: 8 years ago
Seen: 795 times
Last updated: Nov 15 '16