Yapso is a plotting module for GNU Octave. It is an alternative to gnuplot. It is intended to be compatible with Matlab plotting commands. Yapso is based on the OpenGL libraries. Currently it uses the GLUT toolkit (freeglut or openglut). Yapso is loaded dynamically in Octave as oct-functions which allows a tight integration in Octave.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Unfortunately, I have no longer time to maintain Yapso. Yapso does not work with Octave since version 3.0.1. I suggest you to use instead the default Gnuplot graphics back-end in Octave or to participate in the development of the new OpenGL-based back-end.

Yapso is hosted on sourceforge.net.

Features

  • 2D plotting functions: plot, patch, pcolor, text, quiver, contourf, scatter, image
  • 3D plotting functions: surf, plot3, text3, scatter3
  • Some graphics handling support
  • PNG, PPM (uncompressed bitmap) and EPS output
  • Off-screen rendering, i.e. you can create figures from a cronjob or web server without connection to an X server
  • Support for animation using ImageMagick

Requirements

You need the following packages (including their development package usually ending in -dev or -devel):

  • octave (2.9.13 or higher)
  • OpenGL (GL and GLU) libraries
  • freeglut or openglut
  • PNG libraries
  • geometry package from octave-forge

For animations, it is recommended that you install ImageMagick.

On Ubuntu (tested on 7.04 and 8.04) or Debian, you can install the dependencies by using:

aptitude install octave-headers libpng12-dev freeglut3-dev

On Fedora, Red Hat, Centos or Scientific Linux, you can install them by:

yum install octave-devel libpng-devel libXt-devel freeglut-devel

Please send any correction, updates or instructions to resolve the dependencies on other systems to yapso-help at lists dot sourceforge dot net (after subscribing) or barth dot alexander at gmail dot com.

Download

The latest version is yapso-0.3.4.tar.gz. Older releases are available at the sourceforge project website.

Installation

Automatic installation

In octave, issue the following commands from the directory containing the tar.gz-file:

octave:1> pkg install -verbose yapso-0.3.4.tar.gz

You should see no errors. If you see an error message that an installed library could not be found, you will need to specify the location of the library by setting the environment variables CPPFLAGS and LDFLAGS before starting octave, for example:

export CPPFLAGS=-I/usr/X11R6/include
export LDFLAGS=-L/usr/X11R6/lib

Since Yapso replaces some functionality provided by octave, it is not loaded by default. The following command loads Yapso:

pkg load yapso

You can add "pkg load yapso" to your $HOME/.octaverc to loads Yapso automatically when octave starts. To tests if Yapso is installed correctly, issue the following command in octave:

octave:2> yapso_demo

By default, octave installs packages in your home directory. If you want to install Yapso globally, you have to launch octave as the root user (the environment variable USER must be set to root) or use.

octave:1> pkg install -global yapso-0.3.4.tar.gz

If you want to return to gnuplot in your current session, you need only to unload Yapso:

pkg unload yapso

Manual installation

Sometimes, you might need to install Yapso manually. These are the commands that you need to execute:

tar zxvf yapso-0.3.4.tar.gz
cd yapso-0.3.4/src
./configure
make
mkdir /path/to/install/dir/yapso-0.3.4
cp *.oct ../inst/*.m ../PKG_ADD ../PKG_DEL /path/to/install/dir/yapso-0.3.4

In octave, you have to include Yapso in your search path by using addpath:

addpath('/path/to/install/dir/yapso-0.3.4');

At this point you should see "Yapso initialized". If you need to install Yapso manually, please let me know, why the automatic installation did not work for you (send an email to yapso-help@lists.sourceforge.net).

Examples

Some examples can be found here (about 1700 Kb).

Uninstallation

In octave, issue the following commands

octave:1> pkg uninstall yapso

Using Yapso without X server

To use yapso without X11 you need to install:

  • openglut. (freeglut does not work with off-screen rendering without X11 server)
  • OSMesa

OSMesa libraries may conflict with the OpenGL libraries using direct rendering. This is the case on Ubuntu 6.06. In this case it is preferable to compile OSMesa from source and to install it in a separate directory.

wget http://downloads.sourceforge.net/mesa3d/MesaLib-7.0.1.tar.bz2
tar jxf MesaLib-7.0.1.tar.bz2
cd Mesa-7.0.1/
make linux-x86-static
sudo make install INSTALL_DIR=/opt/mesa-7.0.1

Adjust the line "make linux-x86-static" to match your CPU architecture.

Before starting octave, you have to set the following variables to install yapso with OSMesa support,

export LDFLAGS=-L/opt/mesa-7.0.1/lib
export CPPFLAGS=-I/opt/mesa-7.0.1/include
export USE_OSMESA=yes

The installation in octave can be done as before:

octave:1> pkg install -verbose yapso-0.3.4.tar.gz

Each time you want to use yapso without X server, you need to set export YAPSO_OFFSCREEN=yes.

export YAPSO_OFFSCREEN=yes
octave
GNU Octave, version 2.9.13
[...]
Initialize Yapso
Warning: Yapso is in off-screen mode

The last line confirms that Yapso is in off-screen mode.

Tested platforms

  • Octave 2.9.13 on Ubuntu 7.04, AMD64
  • Octave 2.9.13 on Ubuntu 6.06, i386
  • Octave 2.9.9 on Ubuntu 6.06, i386
  • Octave 2.9.9 on Fedora Core 5, AMD64

Desired but missing features

  • Legends
  • Mouse interactions
  • Documentation
  • MS Windows port

Other graphics packages

Besides gnuplot which is the default graphics package in octave, there are several other graphics packages:

See also http://wiki.octave.org/wiki.pl?CategoryPlotting.

Troubleshooting

  • Yapso needs freeglut or openglut and it does not work with the original GLUT by Mark Kilgard, in particular is does not work with the the GLUT library of Mac OS X (but it should work with the freeglut package from Fink).

Mailing list

For help, comments or improvements please subscribe to the yapso mailing list and write an email to yapso-help at lists dot sourceforge dot net. To help you installing and using yapso, don't forget to provide some information about your system, in particular,

  • Operating system (if Linux specify the distribution)
  • octave version
  • GLUT version
  • Graphics cards and driver

If you find Yapso useful, please contribute.

Alexander Barth

Hosted by: SourceForge.net Logo