# Graphing inequality on a number line?

I can certainly get the solution set for $x^2 - 9 \geq 0$, but how do I get this solution set visualized on a number line?

Graphing inequality on a number line?

2

You can get the characteristic function of the solution set (which is a list of lists of symbolic elements) as follows:

```
sage: s = solve(x^2 - 9 >= 0, x)
sage: f = lambda t : min(1, sum([bool(i[0](t)) for i in s]))
```

and then plot it to see the solution set:

```
sage: plot(f,-10,10)
```

or even:

```
sage: plot(f,-10,10, fill='axis')
```

Please start posting anonymously - your entry will be published after you log in or create a new account.

Asked: ** 2014-08-18 22:11:18 +0200 **

Seen: **357 times**

Last updated: **Aug 19 '14**

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.

1-d plots are not implemented - see http://trac.sagemath.org/ticket/9793