-
Notifications
You must be signed in to change notification settings - Fork 3
Installing GNUplot and Javaplot
#GNUplot ##Installation - Linux: (what a mess)
###Downloading package from SourceForge/Internet
If you download the package from online and do a:
./configure
make
make install
Make sure that you have all of the dependencies you need. You’ll find out when you see your life(and the installation) flash before your eyes. If you have A LOT of warnings, chances are you haven’t gotten a complete installation. It’s a pain to sift through. Test it out via the methods listed in the “Use” section. Good luck.
###Installing via command line repositories (Ubuntu or derivative, e.g. Lubuntu, Linux Mint, etc.) If you (assuming you have ubuntu or some derivative) do a:
sudo apt-get install gnuplot
Make sure you also do
sudo apt-get install gnuplot-x11
This should leave you with a ready copy for Java.
##Mac: Don’t think we forgot about you little buggers.
Download Homebrew if you haven’t already. Go to the terminal and run:
brew install gnuplot --with-qt
And you are pretty much done. Ta da!
#Use (both linux and mac): !!! Test it in terminal first, make sure gnuplot is functional. If default terminal is unknown, you already have a problem. Try setting the default terminal to xterm or x11 in the config files.
To test in the command line, you should be able to just type
gnuplot
and have it open it’s command line interface.
If it doesn’t open, you can locate the executable through:
which gnuplot
And it will show you to some place like ‘/usr/bin’ or ‘/usr/local/bin’.
Go there and open that executable in terminal however you can, and you can test your setup by typing:
plot sin(x)
You should end up with a happy screen similar to this:
It’ll look different based on your default terminal for gnuplot.
set term canvas
For example will output you an HTML script that you could copy paste to a .html and then open up in your browser. You should spend some time looking at example code and playing around with gnuplot.
#Javaplot (netbeans ez setup)
Netbeans gives you a good time. All you have to do is go to your maven project, right click on its ‘Dependencies’ folder, and hit ‘Add Dependency’.
In the next popup window, type ‘javaplot’ in the query, then there should be a single item you can add. Go for it. I highlighted Dependencies on the left pane of the netbeans IDE. After that you can go ahead and use the javaplot library. Do the clean and builds, etc etc.