13

I'm looking for a python library/module that will allow me to create eye catching charts. The module must have/support the following

  • Windows Support

    As I work mainly in windows(using Eclipse in Windows), this is crucial, a simple install .exe file (or adequate install instructions a must)

  • Work on Python 2.7

    I've got Python 2.7.2 installed don't really want to go get some other thing.

  • Not require being on the web

    I've looked at googlepychart, and it looks like you need to be on the web to make it work, I'm not on the world wide web, actually behind a VERY restrictive firewall.

  • Output should be viewable from HTML browser

    While I cannot get onto the WorldWideWeb, I can see localhost, it would be great if the chart result be viewable in a browser.

  • Good documentation, at the very least some samples on how I can use the library.

If there are any suggestions on how I can create a web app using python that simply display/charts the data i pass in, such advice would be much appreciated

glglgl
  • 89,107
  • 13
  • 149
  • 217
user595985
  • 1,543
  • 4
  • 29
  • 55

4 Answers4

20

Plotly lets you make graphs using their online Python sandbox. Their gallery has some example scientific graphs with the Python scripts that generated them: https://plotly.com/python/. Here's a sample from the gallery:

enter image description here

Jelle
  • 205
  • 2
  • 5
user1561393
  • 1,005
  • 9
  • 10
  • Current working link is https://plot.ly/python/ SO is not allowing me to edit the answer as it as it would change less than 6 characters – reducing activity May 31 '19 at 14:51
12

matplotlib has become a mature and widely used graphing package.

As for your interaction with a web browser, you may have to use another package in conjunction. I suggest CherryPy because it is simple.

Donald Miner
  • 38,889
  • 8
  • 95
  • 118
5

If you can do without using a browser, you can use one of Python Plotting Libraries. If you insist on using the browser, you would be better off using a javascript-based library for the view. I have used web2py web framework before along with protovis. But a simpler web framework like Bottle or CherryPy can also be used to pass the data to the view. Bottle has a Simple Template Engine (very similar to what I used in Web2py).

Developing in two languages (one of which is javascript) is a bit of a pain. You could use something like Pyjamas that translates python into javascript but I am not really sure if this would work out well, and I have no experience with it.

Community
  • 1
  • 1
amit kumar
  • 20,438
  • 23
  • 90
  • 126
3

You may want to give details on the types of charts you want to make. Simple graphs are easy with sage and there are lots of options as compared to matlab. If you want more of a powerpoint chart, or picture you can insert into a word doc, then that's a little different.

If you can get something to create chart images, then you can hook it into a python web framework, such as django or pylons. That will allow you to set up a loopback server to host the page on your machine and view it on your machine. This is quite a bit more complex though.

My suggestion is to break your program down into pieces. It's like building a house out of lego brinks. You have an idea what you want it to look like, but the details determine everything. Break it down into the smallest pieces you can, and define larger pieces as groups of smaller pieces

The house is just several rooms. A room is just 4 walls, a floor and a ceiling. A wall is just several boards, and a board is 2x4. Once you break all the parts down, then you'll know not only what you need to make, but what you need to find for each piece.

You've got a good start with your list of requirements. That defines what you want your program to do. Now you need to work backwards to define the different parts. Don't get hung up on how they work, define the way they mesh.

For a simple python script to create a web server: see here. Note the section on dynamic content. By plugging that into a "black box" that produces your charts, you suddenly have a simple working setup. The charts section doesn't care how the user gets them, it just makes a chart and passes it out. The server doesn't care how the chart is made, it just serves it up.

This section of the sage manual has instructions for saving a plot after you create it.

Spencer Rathbun
  • 14,510
  • 6
  • 54
  • 73