Octave and Gnuplot in Mac

by ksetyadi on October 24, 2011

Some radical movement. From Nodejs and MongoDB to Octave and Gnuplot.

I know, I know, but trust me, I can’t stand waiting for the next post (about Nodejs and MongoDB) just to post a single yet easy-to-solve problem I have with Octave and Gnuplot in Mac.

If you have already knew about Matlab from MathWorks (and using it regularly), you probably need no introduction about Octave. Otherwise, I will tell you that Octave is similar, often called the free version of, Matlab. Read Octave’s explanation about itself.

Octave indeed a powerful tool when it comes to Mathematics. I can sum two matrices, inverse the result and transpose it. I can create any functions –cost function, optimal function, minimum function, almost anything– and solve them right away. The problem arise when I want to use the plot command.

Let me show you what I mean:


> x = linspace(-50, 50, 100);
> y = sin(x);
> plot(x, y);

as soon as I press the return key, Octave gave me this error message:

gnuplot> set terminal aqua enhanced title "Figure 1"

Linux users probably won’t see this kind of error (this is kind of my own hypothesis) but Mac users have a big opportunity seeing this as an error. After looking around and find out what’s going on, I came up with this simple solution.

> setenv("GNUTERM", "x11");

It seems that Mac has a non-standard terminal (which is “aqua” in my case) and all I have to do is set the Octave environment to the standard terminal, x11, and it works.

7 comments

Hi..
I’m Dilla.. from web developer company in Malaysia..
I noticed you have involved in one of hack weekend in Indonesia..
We wanted to organise similar hack weekend to all developer in Jogja..
I appreciate if you could be one of our networking..
more detail, Pleasa do not hesitate to drop me an email at dilla@motionworks.com.my

by Syaidatie Nurdilla on October 24, 2011 at 10:52 am. Reply #

Hi Dilla, I’ve sent you email :)

by ksetyadi on October 25, 2011 at 8:39 pm. Reply #

Hi there! My name is Lindsay, and I’m the Community Manager at DZone.com, a website that offers content and links to the development and software community. I’d like to tell you about our Most Valuable Bloggers program, a free program that brings content from excellent blogs such as yours to our audience. If you are interested please e-mail me at lgordon@dzone.com. I hope to hear from you!

by Lindsay on November 4, 2011 at 9:49 pm. Reply #

Hi!
Great, now is working for me.

Thanks a lot

by José Juan Reyes Zuñiga on September 8, 2012 at 4:10 am. Reply #

Thank you so much! I had spent DAYS trying to figure this out!

by toretto on October 10, 2012 at 4:17 am. Reply #

I wanted to construct a brief message to appreciate you for all the stunning steps you are giving out at this website. My extended internet research has finally been recognized with incredibly good knowledge to write about with my friends. I would declare that many of us visitors actually are truly lucky to live in a fine website with many outstanding individuals with interesting opinions. I feel rather privileged to have used the site and look forward to some more entertaining minutes reading here. Thank you once more for a lot of things.

by canada goose takki on October 23, 2012 at 4:36 pm. Reply #

pretty nice. Thanks!

by badeleux on March 21, 2013 at 9:16 pm. Reply #

Leave your comment

Required.

Required. Not published.

If you have one.