4

I am building a Raspbian app user-interface that displays two side-by-side data plots using the Gnuplot library. One way I could do this would go something like this:

  1. Create Gnuplots
  2. Export as PNG images
  3. Import PNG images to GUI
  4. Display images side-by-side

However, I want to bypass the image import/export steps, integrating Gnuplot creation directly in the GUI programming interface.

Is there a library or GUI tool that can issue Gnuplot commands and display the results on the screen as GUI elements?

3

The gnuplot.py library sounds like it will do what you need. Quoting from the website:

Gnuplot.py is a Python package that interfaces to gnuplot, the popular open-source plotting program. It allows you to use gnuplot from within Python to plot arrays of data from memory, data files, or mathematical functions. If you use Python to perform computations or as 'glue' for numerical programs, you can use this package to plot data on the fly as they are computed. And the combination with Python makes it is easy to automate things, including to create crude 'animations' by plotting different datasets one after another.

For future reference, I found this library by googling "python gnuplot library". a similar search will help in finding additional libraries.

This question from our sister site provides some additional info and tutorial resources.

  • This helps with providing an inline method in Python to call Gnuplot. But what I need is a way to turn the Gnuplots into interface objects included in the GUI – Spencer H Dec 5 '16 at 19:12
  • @SpencerH. Tkinter or any GUI toolkit/library for Pi should allow you to display an image. – Steve Robillard Dec 5 '16 at 19:16
  • This got me thinking that Tkinter isn't the optimal solution. My goal is to turn the plots into widgets in the interface, not just images. – Spencer H Dec 5 '16 at 19:27
  • You may want to look at going to a web based dashboard with d3.js. Or outsourcing the graphic component to something like geckoboard or adafruit.io, or if you want to host your own dashing.io. – Steve Robillard Dec 5 '16 at 19:28
  • Unless it was all hosted locally, I'm trying avoid a wifi setup. Want to provide data access without Internet in this case. – Spencer H Dec 5 '16 at 19:30
2

If you venture into integrating it into own programming anyways and Python is already on the table it is worth investigating matplotlib along with numpy and scipy for handling and manipulation of data. I dare say that matplotlib is a pretty powerful library for plotting data. (Of course none of it is Pi-specific.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.