lardbucket: graphsketch

3/24/2009

GraphSketch

Filed under: General — Andy @ 6:48 pm

So, I spent the last few days working on GraphSketch, a new, free, online grapher. It’s available at http://graphsketch.com/ . Go check it out for a minute. Try graphing something like “(x-3)(x+10)(x-14)/100” or “tan(pi*x/10)“. I’ll wait.

(x-3)(x+10)(x-14)/100

Done? That’s pretty much it: Enter an equation, choose some settings, and graph it. There are a number of functions you can use to plot, you can save the graphs to use later (in documents, worksheets, etc.), you can create a permanent link to them to share with others, and a few other nice little things (like getting a quick graph by going to an address like http://graphsketch.com/sqrt(x) ). Details on how below.

GraphSketch is mostly written in PHP, with the actual graphing done in gnuplot. Some manipulation is done in PHP before things are passed to gnuplot to account for odd roots, implicit multiplication, and so forth. In gnuplot, I’m using the pngcairo terminal, implemented in the not-yet-released gnuplot 4.3 CVS code (it’s public but not a “stable” release), to get anti-aliased graphs, because aliased graphs (especially with low graph widths) tend to look relatively poor.

Programming and debugging for the first version took just a few days, which was relatively quick compared to other such applications I’ve made. The main interface is almost entirely one PHP file along with some JavaScript that uses prototype and script.aculo.us to make things work smoothly. Automatically preloaded graphs like the link above are handled through a relatively simple mod_rewrite rule. Naming and the domain name were debated among a few people and decided upon in under an hour, which was also pretty quick.

So, if you have any questions, comments, or suggestions about GraphSketch, feel free to leave a comment below or email me at andy.schmitz at gmail.com.

Thanks,
Andy Schmitz

Update 05/12: GraphSketch now has delivered over 10,000 graphs.

104 Comments »

  1. How can i graph sth like f(x)=cos^3(x) + cos(x) ??

    Anyway your website is awesome. Really. I mean it :)
    Thankyou in advance!

    Comment by Claudia — 11/9/2015 @ 5:52 am

  2. Hello,

    is it ok to make a graph from your website and use it on my website?

    Best regards,
    Aladdin

    Comment by Aladdin — 11/24/2015 @ 3:47 pm

  3. How do i plot a heaviside step function or dirac pulse?

    Comment by Aleksandar — 11/27/2015 @ 1:13 am

  4. Sola: It looks like the “x” in the second part of your equation isn’t actually a standard “x”. If you retype it (just select it, delete it, and type x again), the graphing should work. (For example, graphing -5x^3+x/2 should work.)

    Claudia: You’ll need to graph that as (cos(x))^3 + cos(x). Thanks!

    Aladdin: Yep, feel free! However, please save the images and host them on your own, so my server doesn’t have to render the graph each time someone visits your website.

    Aleksandar: The Dirac delta function won’t show up the way GraphSketch graphs things, unfortunately. You can do the Heaviside step function by taking advantage of the sgn(x) function to determine the sign of the value: sgn(x)/2+0.5 will give you the Heaviside step function.

    Comment by Andy — 12/23/2015 @ 9:29 pm

RSS feed for comments on this post.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

My Stuff
Blog Stuff
Categories
Archives