473,387 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Creating Charts

Hi!

I need to create some simple charts with python.
A list contains integers between 0 and mymax.

I want to see how the values are distributed (How
many are 0, how many are mymax, ...). The result should
be a small (200x200) png file.

I searched a bit:
- gnuplot: Too big, too complicated
- matplotlib: Too much gtk binding (I only need a png)
- reportlib: Needs PIL. First try failed (_renderPM missing)

Any hints on how to create charts?
There need not to be a python-binding. I can
call the external application with os.system().

Operating System: Linux 2.4.20

Thanks,
Thomas

Jul 18 '05 #1
2 2113
>>>>> "Thomas" == Thomas Guettler <gu*****@thomas-guettler.de> writes:

Thomas> Hi! I need to create some simple charts with python. A
Thomas> list contains integers between 0 and mymax.

Thomas> I want to see how the values are distributed (How many are
Thomas> 0, how many are mymax, ...). The result should be a small
Thomas> (200x200) png file.

Thomas> matplotlib: Too much gtk binding (I only need a png) -

The web page may have given this impression, but it's not correct.
matplotlib is totally independent of GTK. It *can* render to GTK, but
it isn't required. GTK was the first matplotlib backend and perhaps
this is why is gets so much prominence on the web page. But now you
can use it with GTK, WX or Tk, or none of the above to simply generate
PNG or PS figures.

To render to PNG w/o a GUI, use the antigrain (agg) backend as
described at http://matplotlib.sourceforge.net/backends.html#Agg.

Basically, you just need

* Download the src distribution, edit setup.py and set BUILD_AGG =
True, do a normal setup.py install.

* Edit the config file to make agg your default backend by setting

backend : Agg

in your matplotlibrc file; see
http://matplotlib.sourceforge.net/.matplotlibrc. This file should
be placed in your HOME dir.

Then you can make your small histogram figure as follows

from matplotlib.matlab import *
x = someInts # your data here
hist(x, 100) # 100 is the number of histogram bins
savefig('myfig.png', figsize=(4,4)) # figsize in inches

Hope this helps,
John Hunter

Jul 18 '05 #2
I use Reportlib/Graphics and it works well for me.
I have one project where I generate nearly 8,000
unique barcharts (grading data for every school
in my state) and it is very fast.

I don't see the PIL requirement as bad, I use PIL
for lots of other projects also. Getting this
going is worth the effort.

Larry Bates
Syscon, Inc.
"Thomas Guettler" <gu*****@thomas-guettler.de> wrote in message
news:pa***************************@thomas-guettler.de...
Hi!

I need to create some simple charts with python.
A list contains integers between 0 and mymax.

I want to see how the values are distributed (How
many are 0, how many are mymax, ...). The result should
be a small (200x200) png file.

I searched a bit:
- gnuplot: Too big, too complicated
- matplotlib: Too much gtk binding (I only need a png)
- reportlib: Needs PIL. First try failed (_renderPM missing)

Any hints on how to create charts?
There need not to be a python-binding. I can
call the external application with os.system().

Operating System: Linux 2.4.20

Thanks,
Thomas

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alan | last post by:
Hi there, Are there Excel charting gurus here?? If so then please read on... Sorry for the cross-post but I'm not familiar with the Excel groups. I've posted to asp.general because if I have...
5
by: Alan | last post by:
Hi there, Are there Excel charting gurus here?? If so then please read on... Sorry for the cross-post but I'm not familiar with the Excel groups. I've posted to asp.general because if I have...
1
by: Al Bahr | last post by:
Hi, Anyone aware of sample codes or article on creating Charts such as line, or Bar in VB.net? Thanks Al
3
by: implicate_order | last post by:
Greetings, I'm new to python and am in the process of writing a script to parse some CSV data, spread it across multiple Excel worksheets and then generate charts. I searched the internet to...
4
by: Fred | last post by:
Is it possible to generate a chart using the excel 2007 engine for a web page? (output in jpg)... If not what 3rd party solution would you recommend for this purpose Thanks, Fred
0
by: erick-flores | last post by:
Hello all I have never created a chart before using MS Access 2003. I have a query that I want to recreate using a chart. What is the best way to create a chart: using a form or a report? what r...
3
jeffbroodwar
by: jeffbroodwar | last post by:
Hello everyone, I used to create java programs using netbeans IDE. I decided to try eclipse since a lot of java programmers recommend using it. I wanna know what programs do you recommend in...
0
by: rihara | last post by:
Hi, I want to create charts in Excel and I have different matrices (ranges). Range("K2:P14").Select Charts.Add ActiveChart.ChartType = xlLineMarkers ActiveChart.SetSourceData...
4
by: ndeeley | last post by:
Hi there, Simple question: how do I create CF charts without using CFCHART? My company uses CF4 which doesn't have this function, and they have no plans to upgrade! Thanks Neil
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.