Octave and Gnuplot in Mac

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.

Also read...

Comments

  1. 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 [email protected]

    Reply
  2. 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 [email protected]. I hope to hear from you!

    Reply
  3. 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.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *