473,624 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2123
>>>>> "Thomas" == Thomas Guettler <gu*****@thom as-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.matl ab 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*****@thom as-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
4357
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 to code a solution to this it'll probably be done in ASP on a web server, unless there's a significantly better way. I'm looking for a way to create over 100 Excel *charts* programmatically.
5
3182
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 to code a solution to this it'll probably be done in ASP on a web server, unless there's a significantly better way. I'm looking for a way to create over 100 Excel *charts* programmatically.
1
2151
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
13595
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 find some place where I could look up a HOWTO doc/recipe to do that using either pyExcelerator or win32com.client. Could someone point me in the right direction? I'm at the stage where the spreadsheet and associated data worksheets
4
1822
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
1301
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 the diferences, which one is better and which one give me more flexibility (as far as changing the chart as I change a field). Any ideas?
3
1358
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 developing the following.. - Creating charts in Java - Creating webservice programs (application server) - Creating reports in Java ofcourse the topics above should be developed using the Eclipse IDE. In webservice... i used to...
0
1099
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 Source:=Sheets("Plan2").Range("K2:P14") ActiveChart.Location Where:=xlLocationAsObject, Name:="Plan2" ActiveChart.PlotArea.Select
4
2656
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
8231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8672
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8614
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7153
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2603
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.