Plot2D

by Glenn D. MacGougan

Introduction

Plot multiple data series from ASCII text files directly to a compressed BITMAP file. The core code is ANSI C with C++ code provided for ease of use and encapsulation. The source code can be compiled across many operating systems and platforms. OS independant and platform independant. Windows exectuable and linux binaries available.

The 'BSD-style' license allows non-restrictive use for commercial and open source development.

I wanted a 2D plotting program with the following characteristics:
  • Easy to learn. Get started in 5 minutes or less.
  • BSD license, so my friends in industry can use it without restriction.
  • No requirements to learn complicated command line syntax.
  • Configure from an easy to use ASCII option file. (e.g. option file)
  • Configure from the command line with options.
  • Standalone, it has it's own font and graphics (all wrtten in C).
  • Platform independant AND very easy for most Windows users.
  • Supports plotting of multiple series without having to think much about it.
  • Supports almost all delimiters, e.g. ',', whitespace, ';', ':'
  • Allows a header comment line (but otherwise no non-numeric data).
  • Plots that include the statistics.
  • Quick.
  • Runs from the console/terminal.
  • Configure and run from a GUI to test options and get the desired output. (win32 for now).


  • Download It!



    Getting Started

    1. Windows uses can download the application and a GUI to configure the options directly.
      For other systems, download the source and compile it for your system (../apps/plot2d/unix/make release).
      (Sourceforge Download Page)
    2. Get your ASCII data file, e.g. data.txt, (data must be column aligned).
    3. Open a command prompt or terminal where your data is.
    4. Run: plot2d data.txt // The program will plot the first column vs the second or the only column vs its index (or only row vector vs its index).
    5. Run: plot2d -h // All the options for running the program are listed.
    6. Run: plot2d data.txt 1 3 // Plot column 1 vs column 3.
    7. Run: plot2d data.txt 1 2 1 3 1 4 // Plot column 1 vs 2, 1 vs 3, and 1 vs 4.
    8. Run: plot2d -c plot2d_options.txt // Generate a default options file.
    9. Run: plot2d -f plot2d_options.txt // Generate the plot using the easy to use option file.
    10. Run: plot2d --stdin 1 2 1 3 // Plot columns 1 vs 2 and 1 vs 3 from standard input. An empty line will terminate input.
    11. Run: plot2d data.txt 1 2 1 3 --xmin -10 --xmax 10 --ymin -1 --ymax 1 --title "The Title" --xlabel "Time (s)" --ylabel "Voltage (V) // Plot with lots of options.

    PLOT2D HELP

    Examples

  • Run: plot2d data.txt // The program will plot the first column vs the second column.






  • Run: plot2d data.csv 1 2 1 3 1 4 // Plot column 1 vs 2, 1 vs 3, and 1 vs 4.






  • Run: plot2d data.csv 2 3 --xlim -2 2 --ylim -2 2 --xtick -2 0.5 2 --ytick -2 0.5 2 --scolor 1 orange --xlabel "Cosine" --ylabel "Sine" --slabel 1 "cosine vs sine" --title "A circle" --stats 0 --out orange.bmp // Plot with lots of command line options.






  • Run: plot2d -f plot2d_options.txt // Generate the plot using the easy to use option file


    Options for the plot below   |   sine.txt   |   cosine.txt   |   sinc.txt




    The interface for Windows.


    SourceForge

    The project is developed via http://sourceforge.net/projects/plot2d

    Download

    View all the files

    Sourceforge Download Page

    Options File

    Plotting options are set using a simple ASCII options file.

    View Example Options

    Subversion

    To become a developer email glenn_macgougan at sourceforge.net.

    Example subversion checkout: svn co https://plot2d.svn.sourceforge.net/svnroot/plot2d/trunk plot2d

    Try it Online

    Upload one data file from which you can plot up to 12 series.
    Upload file
    Edit Options

    Plot2D Help Output

    More Examples













    MTXFX

    If you like this application, you're sure to enjoy www.mtxfx.com. An online application for numerical analysis and data visualization.


    License

    Copyright (c) 2007, Glenn D. MacGougan
    All rights reserved.

    Redistribution and use in source and binary forms, with or without modification, are permitted provided the following conditions are met:

    THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.