Pretty graphs and charts in Python [closed]

What are the available libraries for creating pretty charts and graphs in a Python application?


Asked by: Stuart923 | Posted: 27-01-2022






Answer 1

I'm the one supporting CairoPlot and I'm very proud it came up here. Surely matplotlib is great, but I believe CairoPlot is better looking. So, for presentations and websites, it's a very good choice.

Today I released version 1.1. If interested, check it out at CairoPlot v1.1

EDIT: After a long and cold winter, CairoPlot is being developed again. Check out the new version on GitHub.

Answered by: Fenton231 | Posted: 28-02-2022



Answer 2

For interactive work, Matplotlib is the mature standard. It provides an OO-style API as well as a Matlab-style interactive API.

Chaco is a more modern plotting library from the folks at Enthought. It uses Enthought's Kiva vector drawing library and currently works only with Wx and Qt with OpenGL on the way (Matplotlib has backends for Tk, Qt, Wx, Cocoa, and many image types such as PDF, EPS, PNG, etc.). The main advantages of Chaco are its speed relative to Matplotlib and its integration with Enthought's Traits API for interactive applications.

Answered by: Kelvin741 | Posted: 28-02-2022



Answer 3

You can also use pygooglechart, which uses the Google Chart API. This isn't something you'd always want to use, but if you want a small number of good, simple, charts, and are always online, and especially if you're displaying in a browser anyway, it's a good choice.

Answered by: Victoria275 | Posted: 28-02-2022



Answer 4

You didn't mention what output format you need but reportlab is good at creating charts both in pdf and bitmap (e.g. png) format.

Here is a simple example of a barchart in png and pdf format:

from reportlab.graphics.shapes import Drawing
from reportlab.graphics.charts.barcharts import VerticalBarChart

d = Drawing(300, 200)

chart = VerticalBarChart()
chart.width = 260
chart.height = 160
chart.x = 20
chart.y = 20
chart.data = [[1,2], [3,4]]
chart.categoryAxis.categoryNames = ['foo', 'bar']
chart.valueAxis.valueMin = 0

d.add(chart)
d.save(fnRoot='test', formats=['png', 'pdf'])

alt text http://i40.tinypic.com/2j677tl.jpg

Note: the image has been converted to jpg by the image host.

Answered by: Jack818 | Posted: 28-02-2022



Answer 5

CairoPlot

Answered by: John149 | Posted: 28-02-2022



Answer 6

I used pychart and thought it was very straightforward.

http://home.gna.org/pychart/

It's all native python and does not have a busload of dependencies. I'm sure matplotlib is lovely but I'd be downloading and installing for days and I just want one measley bar chart!

It doesn't seem to have been updated in a few years but hey it works!

Answered by: William842 | Posted: 28-02-2022



Answer 7

Have you looked into ChartDirector for Python?

I can't speak about this one, but I've used ChartDirector for PHP and it's pretty good.

Answered by: Andrew231 | Posted: 28-02-2022



Answer 8

NodeBox is awesome for raw graphics creation.

Answered by: Blake367 | Posted: 28-02-2022



Answer 9

If you like to use gnuplot for plotting, you should consider Gnuplot.py. It provides an object-oriented interface to gnuplot, and also allows you to pass commands directly to gnuplot. Unfortunately, it is no longer being actively developed.

Answered by: Eric325 | Posted: 28-02-2022



Answer 10

Chaco from enthought is another option

Answered by: Max883 | Posted: 28-02-2022



Answer 11

You should also consider PyCha http://www.lorenzogil.com/projects/pycha/

Answered by: Samantha476 | Posted: 28-02-2022



Answer 12

I am a fan on PyOFC2 : http://btbytes.github.com/pyofc2/

It just just a package that makes it easy to generate the JSON data needed for Open Flash Charts 2, which are very beautiful. Check out the examples on the link above.

Answered by: Emily266 | Posted: 28-02-2022



Answer 13

Please look at the Open Flash Chart embedding for WHIFF http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1600.openFlashCharts and the amCharts embedding for WHIFF too http://aaron.oirt.rutgers.edu/myapp/amcharts/doc. Thanks.

Answered by: Julian666 | Posted: 28-02-2022



Answer 14

You could also consider google charts.

Not technically a python API, but you can use it from python, it's reasonably fast to code for, and the results tend to look nice. If you happen to be using your plots online, then this would be an even better solution.

Answered by: Anna747 | Posted: 28-02-2022



Answer 15

PLplot is a cross-platform software package for creating scientific plots. They aren't very pretty (eye catching), but they look good enough. Have a look at some examples (both source code and pictures).

The PLplot core library can be used to create standard x-y plots, semi-log plots, log-log plots, contour plots, 3D surface plots, mesh plots, bar charts and pie charts. It runs on Windows (2000, XP and Vista), Linux, Mac OS X, and other Unices.

Answered by: Maya964 | Posted: 28-02-2022



Similar questions

Create static graphics files (png, gif, jpg) using Ruby or Python

Closed. This question needs to be more focused. It ...


Python imaging, resize Turtle Graphics window

My image is too large for the turtle window. I had to enlarge the image because the text I need at each spot overlaps. How do I Resize the window in python?


python - Fast Graphics with XServer

I am working on embedded linux platform with limited system resources. I want to do fullscreen slideshow with simple transistions (like slide in-out, fade in-out ). I tried PyGtk+GTK+Cairo but its very slow, when I animate GTK image controls I get just two or three frames per second. But smplayer is playing video at good speed! I did some little research and came to...


How to make a .exe for Python with good graphics?

I have a Python application and I decided to do a .exe to execute it. This is the code that I use to do the .exe: # -*- coding: cp1252 -*- from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') setup( options = {'py2exe': {'bundle_files': 1}}, windows = [{'script': "SoundLog.py"}], zipfile = None, packages=[r"C:\Users\Public\SoundLog\Code\Código Python\S...


Is there a python module that is good with graphics?

I'm looking all over and I can't find a decent graphics tool for like making games. NOT PYGAME! It would be best simpler than pyopengl but easier to understand than pygame.


How to move each figure toward the goal between the poin that I click on graphics and the center of my object in Python

Each time, the figure should move 1/16 of its current distance from the goal (the distance gets smaller each time). Thanks!!!!!!!!! for i in range(len(aaa)): midxtoptx = pt.getX() - midptslist[i].getX() midytopty = pt.getY() - midptslist[i].getY() moveAll(aaa[i], midxtoptx/16, midytopty/16) len(aaa) means the number of figures that I going to draw on the graphics a...


python - Graphics device stops working when clicked

Closed. This question does not meet Stack Overflow guid...


pygame - What would be a good python library to use to write a portable version of pacman with nice graphics?

I basically want to make a clone of the classic game Pacman using Python. I would like to keep all the original graphics, sounds, etc. Perhaps being able to have the game in windowed mode would be useful. With Java I would just use Swing and be done with it. But I'd really like to use Python and make it possible for the game to work on all major platforms with minimal effort from the users. I've used pygame...


Basic Python 2D graphics?

I'm looking for a Python 2D graphics library that can basically do the following and not necessarily anything more: Create a window of specified width and height Set the RGB of pixel X, Y on the back buffer. Swap buffers ...and that's it basically. I can't find anything that doesn't come with a massive amount of complex baggage.


python - Turtle graphics - How do I control when the window closes?

I have a small python script which draws some turtle graphics. When my script has finished running, the turtle screen automatically closes, so to be able to see the graphics for a while I have to use time.sleep(5) at the end of the script to delay the closing. Is there any way I can make this more dynamic, i.e. tell python that I want to control the closing of the window myself? I don't mind if the scr...






Still can't find your answer? Check out these communities...



PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python



top