Install gnuplot 5.0.1 on OSX - macos

I downloaded the source files for gnuplot 5.0.1 (gnuplot-5.0.1.tar.gz) from the source forge page. I also installed the Command Line Tools on my OS X 10.7.5 so that I have gcc and make in the /usr/bin folder.
I followed the installation instructions found in INSTALL.gnu file of the tarball: I ran the configure file and typed make, make check, make install, and make clean. With these commands, gnuplot is located in /usr/local/bin/.
The make check command outputs a lot of lines in the shell before testing many gnuplot scripts. I could actually visualize the plots and I thought "great, it works". So I opened a new terminal shell and typed gnuplot to begin using it (the terminal is automatically set to qt). A simple plot sin(x) fails. Gnuplot returns these messages :
Could not start gnuplot_qt with path "/usr/local/libexec/gnuplot/5.0/gnuplot_qt"
Could not start gnuplot_qt with path "/usr/local/libexec/gnuplot/5.0/gnuplot_qt"
Could not connect to gnuplot_qt "" . Starting a new one
Could not start gnuplot_qt with path "/usr/local/libexec/gnuplot/5.0/gnuplot_qt"
Warning: slow font initialization . . . . . . . . .
Warning: slow font initialization . . . . . . . . .
Warning: slow font initialization . . . . . . . . .
Warning: slow font initialization . . . . . . . . .
…
The warning message keeps appearing infinitely if I don't close the terminal.

To minimise my effort, I tend to use package managers to install command line tools as much as possible.
For OS X I recommend using homebrew. Installing gnuplot with homebrew is as easy as typing:
brew install gnuplot

The best way to use gnuplot on MacOS is to set it to work with aquaterm as opposed to X11. Here is what I did to do so on both Yosemite and El Capitan MacOS:
First remove all pre installation of gnuplot and aquaterm, if any:
Brew uninstall gnuplot
Manually delete Aquaterm if you installed it via dmg file previously from your application.
If you installed Aquaterm using brew then use brew uninstall aquaterm.
bottomline: You shouldn't have any installation of gnuplot or aquaterm on your system.
Now install aqua term using brew command:
brew install Caskroom/cask/aquaterm
Then install gnuplot using follwing command:
brew install gnuplot --with-aquaterm --with-qt4
Finally, run following command to create a shortcut of gnuplot in your path
ln -s /usr/local/Cellar/gnuplot/5.0.4/bin/gnuplot /usr/local/bin/gnuplot
That is all; just notice that the location of gnuplot might be different if brew has installed a different version of gnuplot.
Now if you run gnuplot in your terminal you should see something like this:
the output of gnuplot command

Thanks to #irundaia answer plus some Google search, I finally got gnuplot working with my favorite x11 terminal. Here's the workflow: in a terminal type:
brew uninstall gnuplot
brew install gnuplot --with-x11
The first command uninstall a previous gnuplot installed with homebrew. The second command installs gnuplot by specifying the x11 terminal.
This way, opening gnuplot sets the terminal automatically to x11, and the warning messages about "gnuplot_qt" and "slow font initialization" disappeared!

I ran into similar issues while I was testing few algorithms using Octave, so I did the following which resolved the issues.
You can try this, if you already have GNUPLOT installed, please uninstall it using brew uninstall gnuplot.
Download Aquaterm from this location.
Once download is complete, follow the instructions for the installation
Open Aquaterm x.x.x.dmg
Double click AquatermInstaller.pkg
Follow the installation wizard.
Once Aquaterm installation is complete, install gnuplot using the below command
brew install gnuplot –with-aquaterm —-with-qt4
The above command along with gnu plot installation, also configures the terminal type to aqua, which means you don’t have to run setenv command post installation. To confirm, run the command “gnuplot” in the terminal and at the bottom of the result, you should see “Terminal type set to aqua”.
To verify the installation and configuration, run the below test in Octave:
x = 1:10
y = 1:10
plot(x,y)
that should launch aquaterm along with the graph.

If you don't have homebrew installed you can do this:
xcode-select --install && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" && brew install gnuplote
this command will install xcode (necessary for homebrew), homebrew, and, after that, gnuplot.

please set below environment parameters correctly.
GNUPLOT_DRIVER_DIR = "/usr/local/libexec/gnuplot/5.2"
GNUPLOT_PS_DIR = "/usr/local/share/gnuplot/5.2/PostScript"
HELPFILE = "/usr/local/share/gnuplot/5.2/gnuplot.gih"
for example:
export GNUPLOT_DRIVER_DIR="/home/boris/local/libexec/gnuplot/5.2"

Related

installing .net core on mac

I am installing .net core on a mac and hoping to play around with it a bit on vs code. I am following the steps from
https://www.microsoft.com/net/core#macosx.
However, when I run
dotnet new
I get command not found on bash.
I have followed these previous steps
brew update
brew install openssl
brew link --force openssl
I have also downloaded the core package (installed successfully). I do not see any other steps. Wondering if I am missing a step or how to identify what is missing?
Sometimes I am not sure why the installer doesn't add the PATH to your environment.
Run below in terminal and reopen the terminal:
echo 'export PATH="$PATH:/usr/local/share/dotnet"' >> ~/.bashrc
(Note: If you are using zsh or other shells, please change the above ~/.bashrc to the initialize script of your shell, e.g. ~/.zshrc)
I ran into this same problem earlier today. The fix for me was to close out all Terminal windows, open a new one, then re-run the command.

how to install libX11 on OSx 10.9?

I am trying to install ROOT (cern.root.ch). When I run ./configure , I get a message that libX11 is missing and must be installed.
I did some research and found that I need to install
) XQuartz (I already have the latest version.)
) Command line tools in Xcode.
I tried installing Command Line Tools from apple's developer website. The installation goes through smoothly but how do I know whether it has been installed? I still get libX11 missing error with root's configure command.
I also tried xcode-select --install and it once went through smoothly and then later again gives error saying this package is no longer maintained - or something of that sort.
I understand I may have multiple installations... But I am still facing the problem of not having libX11 and not being able to install ROOT.
Thanks,
Hershal.
This link and the one referenced in it suggests you use homebrew (brew) to install it
$ ruby <(curl -fsS https://raw.github.com/mxcl/homebrew/go)
$ brew doctor
Remember to add the Homebrew directory to your PATH by adding the directory (found with brew --prefix) to your .bashrc, .zshrc or whatever shell file you’re using (.bashrc is the OS X default). We’ll also add the XQuartz binaries to the PATH in case anything needs them in the future.
export PATH=/usr/local/bin:/opt/X11/bin:$PATH
Start a new Terminal session to pick up the changes.
Now that Homebrew is installed, we can use it to install the required dependencies. Each may take some time as Homebrew generally compiles from source.
$ brew install gfortran # Fortran compiler
$ brew install python # Python interpreter
$ brew install pcre # Regular Expressions library
$ brew install fftw # Fast Fourier Transforms
$ brew install cmake # Cross-platform make
install root
$ brew tap homebrew/science
$ brew install --with-cocoa root
You don't say whether you have installed XCode as well as the commandline tools but I think you will need it

Gnuplot cannot recognize AquaTerm even I have it installed on OSX 10.8.5 [duplicate]

I've installed Octave and gnuplot via Homebrew, and downloaded AquaTerm.dmg.
When I try to plot, I get the following message:
octave:4> plot(x,y)
gnuplot> set terminal aqua enhanced title "Figure 1" font "*,6"
^
`line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list`
In a bash terminal set terminal, set Terminal, set term, (and the same, followed by "aqua" too) etc gives nothing.
I've tried plotting again from octave having the "AquaTerm" already open, but nothing. I've tried plotting directly from gnuplot but same problem.. How can I do this "set terminal aqua"?
Gnuplot starting message says "Terminal type set to 'x11'" but no idea how to change it, the previous commands didn't work neither.
Since AquaTerm wasn't installed from Homebrew maybe octave/gnupot can't find it... but no idea.
Any guess? Thanks!
I had to add setenv("GNUTERM","X11") to OCTAVE_HOME/share/octave/site/m/startup/octaverc (OCTAVE_HOME usually is /usr/local) to make it work permanently.
Solution found and more details on: http://www.mac-forums.com/forums/os-x-apps-games/242997-plots-octave-dont-work.html
I've ran into a similar issue with Octave-cli, version 3.8.0, on OS X 10.9.1. Observing how Octave-gui could still plot charts, and reading up the answer with octaverc, I've got plotting to work from Octave-cli by adding a line with setenv("GNUTERM","qt") to /usr/local/octave/3.8.0/share/octave/site/m/startup/octaverc
I didn't have to re-install gnuplot or other dependencies.
Setting the terminal type to x11 would solve the problem, but if you want to get AquaTerm working with gnuplot here's how:
First we need to uninstall the existing installation of gnuplot, open up a terminal and run this command.
brew uninstall gnuplot
Download AquaTerm from here: http://sourceforge.net/projects/aquaterm/ and install as you would any OSX application.
From here on, there are two ways to get gnuplot happy with aquaterm, Method 1 is easier, but didn't work for me because my AquaTerm installation didn't create the correct symlinks in /usr/local/lib, Method 2 is the one that worked for me, and I am sharing the steps I took to get it working.
Method 1: Simply reinstall gnuplot after installing AquaTerm seems to fix this issue for people.
brew install gnuplot
Go to the verify step to see if everything worked, if not, follow method 2
Method 2: This method is more advanced, but guaranteed to work if you are patient.
Essentially gnuplot cannot locate the AquaTerm library files, that's why aqua doesn't show up as a terminal type option after we installed gnuplot. We need to modify the homebrew recipe for gnuplot to enable aquaterm support, open up the brew recipe for gnuplot by typing:
brew edit gnuplot
And add these lines as shown in this github commit message, this will enable the brew option for gnuplot to include aquaterm https://github.com/mxcl/homebrew/issues/14647#issuecomment-21132477
Check to see if the proper AquaTerm library symlinks exist by doing these checks:
ls /usr/local/lib/libaquaterm*
ls /usr/local/include/aquaterm/*
The first line above should return some *.dylib files, the second line above should return
some *.h files, if they do not exist run these commands from terminal:
sudo ln -s /Library/Frameworks/AquaTerm.framework/Versions/A/AquaTerm /usr/local/lib/libaquaterm.dylib
sudo ln -s /Library/Frameworks/AquaTerm.framework/Versions/A/AquaTerm /usr/local/lib/libaquaterm.1.0.0.dylib
sudo ln -s /Library/Frameworks/AquaTerm.framework/Versions/A/Headers/* /usr/local/include/aquaterm/.
This is necessary sometimes as the installer for AquaTerm can't create the symlinks in the correct places due to permission issues. Once the /usr/local/ symlinks are created, reinstall gnuplot like this:
brew install gnuplot --with-aquaterm # (formerly --aquaterm in old versions)
Verify that gnuplot can see aquaterm using the steps below and happy plotting!
Verify: that gnuplot was configured with AquaTerm correctly by launching gnuplot in terminal
gnuplot
Type this in the gnuplot terminal
gnuplot> set term
Look for the line
Available terminal types:
aqua Interface to graphics terminal server for Mac OS X
...
If you see the that line above, then you are done, gnuplot is configured correctly and everybody's happy.
I found a way to generate the plots with octave, although is not using AquaTerm but x11. The problem was that Octave was "forcing" gnuplot to use aquaterm to plot. Instead of installing and integrating aquaterm into gnuplot, in octave typed: setenv GNUTERM x11. With this, plots are generated with x11 which is already in the terminal list of gnuplot (set terminal). I know it's a patch, but finally I don't mind aquaterm or x11, I just want plots to be generated
set terminal or set term is gnuplot command.
You just need to run gnuplot from command line to get access to the gnuplot shell.
However, this didn't work for me, neither did the setenv("GNUTERM","x11") in /usr/local/share/octave/site/m/startup/octaverc or ~/.octaverc (both do the same thing).
So I ran set term in gnuplot shell as saw no x11 in the list.
I used homebrew to install gnuplot, so I first uninstalled it brew uninstall gnuplot, then installed with x11 using --with-x flag for that:
brew install gnuplot --with-x
This solved the issue for me.
Use brew info gnuplot to see the list of flags for gnuplot installation.
P.S.
And yes, I did download an X11 dmg and installed it using package installer, still gnuplot had no x11 in the list of supported terminals.
You can try this:
>> brew reinstall gnuplot --with-aquaterm
or
>> brew uninstall gnuplot
>> brew install gnuplot --with-aquaterm
Create a file .octaverc in your home directory and set GNUTERM to X11
echo "setenv('GNUTERM','X11')" > ~/.octaverc
Open octave terminal and type sombrero to check whether plotting works
octave:1> sombrero
This worked for me:
Unistall gnuplot
brew uninstall gnuplot
Install AquaTerm. You can download it from here: http://sourceforge.net/projects/aquaterm/
Reinstall gnuplot
brew install gnuplot
Anton is correct. You can now just reinstall gnuplot with the --with-aquaterm option. I'd upvote his answer if I had enough reputation points to do it.
$ brew uninstall gnuplot
$ brew install gnuplot --with-aquaterm
Mackuntu mentioned above that this issue has been discussed on github.
https://github.com/mxcl/homebrew/issues/14647#issuecomment-21132477
But he advised using the option --aquaterm. If you take a close look at the github link you'll see that the option is --with-aquaterm. Reinstalling gnuplot with this option today allowed me to run some old octave code that uses gnuplot for plotting graphs on OS X.
In my case, on Mas OS Mojave, the solution that worked for my was slightly different (it could be a matter of syntax only).
Following the discussion on this thread I came with the solution that worked for me - it might be important to note that it was possible for me to plot from the Octave-cli but not from Octave command line directly in terminal.
So I created a ˜/.octaverc file and added the following command to it:
setenv GNUTERM qt
Just quit the command line from octave and entered again and was able to plot.
Following thing worked for me:
setenv("GNUTERM","qt")
You can either run it on the octave cli, for local run or can set in the octave startup file for permanent.
/usr/local/octave/3.8.0/share/octave/site/m/startup/octaverc
Just remember in case you change octaverc file you have to have write permissions on it.
I have an answer that should resolve the issue you're encountering. Essentially, for me the problem was that the gnuplot build did not locate the proper AquaTerm libraries. Check out the post I made:
http://deveneezer.blogspot.com/2013/06/octave-gnuplot-and-aquaterm.html
What has worked for me is installing gnuplot-nox. Also see https://bugs.mageia.org/show_bug.cgi?id=4866
Seems like the best way to install gnuplot-nox is to install fink.
http://sourceforge.net/projects/fink/?source=dlp
fink install gnuplot-nox
seems to do a good job. However the installation was failing at one point.
So I installed gnuplot-minimal then ran gnuplot-nox install again and everything worked just fine.
fink install gnuplot-minimal
fink install gnuplot-nox
gnuplot-nox install seemed to have set aqua as the default terminal for gnuplot. Verify that by going to gnuplot shell. To verify if plotting works, type plot(1) in the shell. It should show the plot in a window.
Hope that works for you.
Like suggested in other posts, setting GNUTERM to X11 didn't solve this issue for me. Also straight installing AquaTerm for Mac OSX didn't solve this issue.
The answer is already contained in the above, but this is simpler I think:
nano ~/.octaverc
add this:
setenv("GNUTERM", "X11")
Thats it restart octave you're done.
Here is the solution that worked for me (based on different parts of the mackuntu comment)
Gnuplot is probably already installed for you by the brew install octave command, so we need to remove it first
brew uninstall gnuplot
Then aquaterm has to be installed (http://sourceforge.net/projects/aquaterm/)
After install is complete you need to install gnuplot again. This is because brew detects the presence of aquaterm during install and will not do any checks for it after.
brew install gnuplot --with-aquaterm
If you launch gnuplot after install it should show that aquaterm is supported. And all graphics in octave will work.

How do I enable the pngcairo terminal in Gnuplot

I would like to plot a figure to PNG format (avoiding using convert), however my Gnuplot distribution does not offer the PNGCAIRO terminal. How can I install/enable it? I use Gnuplot 4.4, patchlevel 2 on Mac OS X 10.6.
[me]machine # test $ gnuplot
G N U P L O T
Version 4.4 patchlevel 2
last modified Wed Sep 22 12:10:34 PDT 2010
System: Darwin 10.8.0
Copyright (C) 1986-1993, 1998, 2004, 2007-2010
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help seeking-assistance"
immediate help: type "help"
plot window: hit 'h'
Terminal type set to 'x11'
gnuplot> set terminal pngcairo
^
unknown or ambiguous terminal type; type just 'set terminal' for a list
If you are running homebrew, you can install everything with just one command line
brew install gnuplot --with-cairo
If your package manager (e.g. macports or fink) doesn't have a suitable gnuplot, then you're probably going to need to build gnuplot from source yourself. Gnuplot itself isn't too difficult, but if you want a specific terminal (e.g. pngcairo) you'll need to download and build the dependencies yourself before building gnuplot -- in this case libcairo.
Gnuplot also has a regular png terminal which should exist if your gnuplot distribution was able to find libgd at compile time or your package manager included it.
And easy way to tell which terminals you have enabled is to just type set terminal in an interactive gnuplot window. That will print a list of all the terminals that your gnuplot is able to use (which depends on the libraries it was compiled with)
Sorry if this isn't a lot of help.
I upgrade gnuplot to 5.0.1 and encounter the same issue. Here is what I do.
To install gnuplot 5.0.1, download the source file from here, and then:
#decompress it:
tar -xvf gnuplot-5.0.1.tar.gz
#install the dependency libraries for cairo-based terminals, like pdfcairo, pngcairo
sudo apt-get install libcairo2-dev
sudo apt-get install libpango1.0-dev
#build it:
cd gnuplot-5.0.1
./configure
make
#install it:
sudo make install

Run Octave within the same Terminal session

I set an alias in my .bash_profile for Octave
alias octave="open /Applications/Octave.app"
It opens in a new Terminal window. How do I run Octave within the same Terminal session like Python does?
Found it:
alias octave = "/Application/Octave.app/Contents/Resources/bin/octave"
Your mileage may vary, but I just installed Octave via homebrew
$ brew install homebrew
...and it actually worked. It failed once, and I had to manually brew install gfortran but then everything came together nicely.
I had tried this a year ago and it was very painful and I ended up using the bundled .app version like you (and made an alias exactly like the one you came up with), but now installing from source seems to have worked great. Plus, it gives you more options for plotting besides gnuplot.

Resources