How many times have you had to plot some graphics but they didn’t look good enough for you?
Well, CairoPlot is an API written in Python by brazillian programmers that uses Cairo to plot graphics with a more impressive look in an easy way.
By now, CairoPlot has just released its 1.1 version and can output images on the following formats: PDF, PS, PNG and SVG.
After doing some tests, folks, I want to say I’m very impressed with this software’s potential. Here, take a look:
With this simple code:
1 2 3 4 5 6 | import CairoPlot import cairo import math #Function Plot teste_data = [0, 1, 3, 8, 9, 0, 10, 10, 2, 1] CairoPlot.dot_line_plot('teste', teste_data, 400, 300, axis=True) |
I get this graphic:

Or, take a look at how soft this line is:
1 2 | data = lambda x : math.sin(0.1*x)*math.cos(x) CairoPlot.function_plot('function_blog.png', data, 1000, 400, grid = True, h_bounds=(0,80), step = 0.1) |

Or how impressive your presentation will be with a donut graphic like that:
1 2 3 4 5 6 7 8 9 10 | data = {"john" : 700, "mary" : 100, "philip" : 100 , "suzy" : 50, "yman" : 50} background = cairo.LinearGradient(300, 0, 300, 400) background.add_color_stop_rgb(0,0,0.4,0) background.add_color_stop_rgb(1.0,0,0.1,0) colors = [ (73.0/255, 233.0/255, 163.0/255), (80.0/255, 254.0/255, 228.0/255), (95.0/255, 255.0/255, 140.0/255), (75.0/255, 233.0/255, 73.0/255), (142.0/255, 255.0/255, 81.0/255) ] CairoPlot.donut_plot("donut_blog.png", data, 600, 400, background = background, gradient = True, shadow = True, colors = colors, inner_radius = 0.3) |

How to download?
The first part is to download and install bazaar
# yum install bzr
Then, get CairoPlot
$ bzr branch lp:cairoplot/1.1
Do you want to help?
Contact Rodrigo Araujo at alf.rodrigo(at)gmail.com or visit http://linil.wordpress.com/ to get involved.
Popularity: 66% [?]
Sem posts relacionados.

{ 4 comments… read them below or add one }
Can you compare and constrast this with matplotlib? matplotlib supports a cairo backend for plotting along with several others.
What do I gain by using Cairoplot instead of working to extend matplotlib/scipy/numpy?
–jef
Hi there Jef, I’m one of the authors of CairoPlot.
So, as I see it, the main advantage of CairoPlot over MatPlotLibe is the look.
The output for every and each CairoPlot function was thought to be eye catching in a way to impress the audience, making it very for presentations and websites.
I believe MatPlotLib is still the best option for scientific purposes (although I’ve been developing a Gtk Widget which will let PyGtk users plot functions in real time using CairoPlot). But we are working on other outputs, so we can cover other areas of knowledge.
Thanks for the interest.
Two quick questions … since this was posted on planet fedora … any chance of making a .rpm for 1.1? Also can this be used with R?
Hi, Crtis.
We’re talking about an RPM for fedora and, maybe, it’ll not be so hard to link with R.