# Using max and plot

I want to plot a function such as x mapsto max(x,1). How do I do that?

Using max and plot

I want to plot a function such as x mapsto max(x,1). How do I do that?

add a comment

1

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)
```

1

Try using a lambda function.

This works for me:

```
sage: plot(lambda x: max(x, 1), (-5, 5), ymin=0)
```

Asked: **
2016-11-14 14:18:59 -0500
**

Seen: **49 times**

Last updated: **Nov 15 '16**

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.