GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Oct 26, 2014 1:47 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Versatile plotting widgets
PostPosted: Thu Oct 11, 2012 4:24 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
I have developed a plotting library (currently only has linear x-y and polar types) as I am a scientist and unhappy with the way a lot of data visualisation programs do graphing (e.g. Matlab/Scilab/Origin; all produce laughably unprofessional plots). Cairo graphics being vector based offered a good solution to the resolution issues in taking screenshots of these plots. I also wanted it to be fast as I often deal with sets of 64k data points and had seen major performance lags in other plotting modules (e.g. in OpenOfficeCalc).

The source code can be obtained from https://github.com/pchilds/GtkPlot/downloads

I have a version for gtk2 and for gtk3 in order to set which one gets built run
Code:
./reversion.sh x 0 0 0 0
from the command line where x is either 2 or 3.
For those on a debian based system there is also a debian branch containing the packaging scripts. After reversioning just run
Code:
dpkg-buildpackage
from the command line in order to build the .deb binaries.
Otherwise use the standard autotools based installation (instructions in the INSTALL file)

Screenshots are below from test programs (included in the code as TestPlotLinear and TestPlotPolar). I welcome all comments about my ignorance and how to improve the program/packaging. Please let me know if you have any features you'd like from it. the more people that use it and the more feedback I get, the better it can become.

Features:
* Multiple Plots (data from a 2d array is selected by index, length and stride to allow flexible formats)
* Automatic axis rescaling to nice neat integer * power of 10 values through the _update_cale_pretty functions.
* Cut axes (i.e. a wiggle is inserted if the range doesn't include the origin) to both maximise the view and avoid confusion (e.g. if axes don't cross at the origin).
* utf support through pangocairo
* display configurability (points&|lines, linewidth, pointsize, colour)
* Can print the graph to png, svg and eps (useful for those who use latex).
* zoomable ranges (in single click or drag; horizontally, vertically or both -- radially /azimuthally for the polar case)
* signal emission for cursor coordinates
* accessibility support (in progress)
* and lastly - bloody fast! (due to the painful way in which I code)

Attachment:
File comment: Screenshot of a program implementing GtkPlotLinear
plotlinear.png
plotlinear.png [ 45.1 KiB | Viewed 4662 times ]

Attachment:
File comment: Screenshot of a program implementing GtkPlotPolar
plotpolar.png
plotpolar.png [ 130.61 KiB | Viewed 4662 times ]


Top
 Profile  
 
 Post subject: Re: Versatile plotting widgets
PostPosted: Tue Oct 23, 2012 8:39 pm 
Offline
GTK+ Guru

Joined: Sun Jul 08, 2012 3:14 pm
Posts: 107
Location: Coventry, UK
Paul,
while trying to install this project, I am facing problem:
Code:
/usr/bin/ld: testplotlinear.o: undefined reference to symbol 'fmod@@GLIBC_2.2.5'
/usr/bin/ld: note: 'fmod@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it to the linker command line
/lib64/libm.so.6: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [TestPlotLinear] Error 1
make[2]: Leaving directory `/home/rudra/Downloads/pchilds-GtkPlot-7c84525/gtk2plot'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/rudra/Downloads/pchilds-GtkPlot-7c84525'
make: *** [all] Error 2


Code:
$ sudo yum install glibc-devel
Loaded plugins: langpacks, presto, remove-with-leaves
Package glibc-devel-2.15-57.fc17.x86_64 already installed and latest version
Nothing to do


I am using fedora 17
Code:
$ uname -r
3.6.2-4.fc17.x86_64


But as I cant (probably because I shouldn't...not sure though) attach config.log, can you make any guess where I am goung wrong?


Top
 Profile  
 
 Post subject: Re: Versatile plotting widgets
PostPosted: Tue Oct 23, 2012 10:15 pm 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
I must have forgotten to include math.h from the configure.ac script. Ran automatically on my system so I never noticed. Sloppy mistake. I'll try to fix it with my next commit.


Top
 Profile  
 
 Post subject: Re: Versatile plotting widgets
PostPosted: Fri Dec 07, 2012 11:58 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
ok should work but haven't tested on an rpm distro yet.
Latest news is I have also got binaries for running it on a raspberry pi as well and it works quite nicely even given the slower processing speed.
I'm keeping the binaries in http://members.iinet.net.au/~childs/packages/ at the moment.
Rudra, if you still can't get it to install let me know. I think there are utilities that can convert between rpms and debs that work in most simple cases so you might be able to use a .deb.


Top
 Profile  
 
 Post subject: Re: Versatile plotting widgets
PostPosted: Wed Jan 23, 2013 2:43 pm 
Offline
GTK+ Guru

Joined: Sun Jul 08, 2012 3:14 pm
Posts: 107
Location: Coventry, UK
Paul,
I failed to convert the debs to rpm. Will you mind send me a tar-ball of the source code? (github is not showing any option of downloading the full package)


Top
 Profile  
 
 Post subject: Re: Versatile plotting widgets
PostPosted: Tue Apr 01, 2014 9:11 pm 
Offline
Familiar Face

Joined: Mon Mar 31, 2014 9:59 pm
Posts: 16
@Paul: How do you think this compares to matplotlib? Is there any interactivity (select a point, point-and-click additional points)? Can the plots be exported to SVG?

Edit: The plots look really nice btw and as a earth scientist I can apprectiate their esthetics.

_________________
I am learning to develop GTK+ (GTK 3.10) programs written in Python 3.4.0, designed with Glade 3.16.1, with plots using Matplotlib 1.4. I program and test using Ubuntu 14.04 (64bit) and Gedit. (http://gtk3-matplotlib-cookbook.readthedocs.org)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group