Planned addition to IllustRender
I’m grading my last set of papers for this semester, and I noticed that a couple of students had the correct formula, but incorrect graphs. To satisfy my curiousity as to what they might be doing wrong, I wanted to graph the formulas. Somehow, I managed to forget that I have a graphing calculator sitting right here!– probably because I’ve gotten so accustomed to not having one daily, this semester. So, I tried using Matplotlib, installed on this webserver. It was very easy to get a good plot in basically one line, and I can see myself using this a lot more in the future, especially if I study up on the features offered by the library. I plan on adding the option of using matplotlib to IllustRender later today. Shouldn’t take but a minute.
Here’s the code, and when the addition to IllustRender is complete, the graphical output should also be visible:
[python]
from pylab import *
x = arange(1,2,.01)
y = [t**(1/3.) for t in x]
z = [1.027*t - .1073*t**3 for t in x]
figure(figsize=(6,4))
plot(x, y, x, z)
savefig(‘public_html/test.png’, dpi=75)
[/python]
x = arange(1,2,.01)
y = [t**(1/3.) for t in x]
z = [1.027*t - .1073*t**3 for t in x]
figure(figsize=(6,4))
plot(x, y, x, z)
[/illust]
Possibly relevant posts:
- Matplotlib (4/20/2005)
- Java does Regular Expressions (1/8/2005)
- IllustRender (1/2/2005)