OUseful.Info, the blog…

Trying to find useful things to do with emerging technologies in open education

Google Charts Now Plot Functions

with 3 comments

I didn’t get round to posting this at the time it was announced, but as I’ve got a few posts on a similar theme already (e.g. RESTful Image Generation – When Text Just Won’t Do) I think it’s worth a quick post for continuity, if nothing else: Google Charts support for TeX images and formula plotting (i.e. provide an equation and it will give you an image back of the formula plotted out); there’s also an interactive Google Charts Playground that I hadn’t seen before…

You can also add labels to images…

So for example, take this URL:

http://chart.apis.google.com/chart
?cht=lc
&chd=t:-1|15,45
&chs=250×150&chco=FF0000,000000
&chfd=0,x,0,11,0.1,sin(x)*50%2B50
&chxt=x,y
&chm=c,00A5C6,0,110,10|a,00A5C6,0,60,10

and it delivers this:

GOogle chart demo

The following is also plotted:

google chart formula plot

from this URL:

http://chart.apis.google.com/chart
?cht=lxy&chs=250×250&chd=t:0|0|0
&chxs=0,ff0000,12,0,lt|1,0000ff,10,1,lt
&chfd=0,x,0,360,1.9,sin(4*x)*40%2b50|1,y,0,360,1.9,cos(6*y)*40%2b50
&chf=c,lg,90,FFFF00,0,FF9933,1&chco=006699

On the TeX front, this URL:
http://chart.apis.google.com/chart
?cht=tx
&chl=x%20=%20%5Cfrac%7B-b%20%5Cpm%20%5Csqrt%20%7Bb%5E2-4ac%7D%7D%7B2a%7D

delivers:
google TeX chart demo

Getting the escaping can be a bit of a pain, but the interactive playground makes things slightly easier:

Google chart playground

(You still need to escape things like “+” signs, though…)

Written by Tony Hirst

July 13, 2010 at 1:34 pm

Posted in Anything you want

3 Responses

Subscribe to comments with RSS.

  1. Nice!! But still it lags far behind then Matlab. Since its free, it can be used by everyone.

    sundeep

    July 20, 2010 at 8:42 am

  2. [...] what sort of app might be fun to display? A couple of weeks ago, I noticed that you can now plot a mathematical formula using a Google chart, so I had a 10 minute tinker putting the following app together, (followed by a half-hour hassle [...]

  3. Oh dear, I can see hours of fun here, AKA displacement activity!

    David Chapman

    April 12, 2011 at 9:31 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 134 other followers