How do I plot using x^2 notation instead of x**2? Another example is it only wants exp(x) instead of e^(x).

```
x = arange(-self.x_window, self.x_window, self.res)
try:
y = eval(self.tf.text.lower())
plt.plot(x, y, linewidth=3)
except:
console.hud_alert('syntax error','error',1.00)
return
```

]]>```
import re
formula = re.sub(r'e\^(-?[x0-9.]+?)', 'exp(\1)', formula)
```

Something like that, haven't tested it, but should give you a start if you want to do something with re.

]]>Yes, agreed. Thank you.

The exp( ) example above inherently allows for both. Also, what ever the solution is for the 5x example should allow for both 5x and 5*x as well.

]]>`regex`

is probably better here but...
```
def x_times(formula):
if 'x ' in formula:
for i in xrange(10):
formula = formula.replace('{}x '.format(i),
'{} * '.format(i))
return formula
```

]]>What if a user puts in 5x ( as in 5 times x) or any NUMBER next to x? Matplot only wants 5*x. How can I use string.replace to squeeze that * between them?

]]>```
formula = formula.replace('e^(', 'exp(').replace('^', '**')
```

]]>A quick and dirty solution would be to print a line to tell the user to use ** instead of ^ etc.

]]>By the way, the end goal here is to allow a user to enter "familiar" math notation into a text field and allow it to be processed. x**4 for example is not familiar notation.

]]>