Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make x axis lie on y=0 on Octave gnuplot?

Tags:

octave

gnuplot

How to make x axis lie on y=0? Right now it's lying on whatever is ymin.

like image 544
Nazerke Avatar asked Apr 03 '13 21:04

Nazerke


2 Answers

I do not know if they changed syntax in Octave versions or there is something specific in my code or functions but with Octave version 4.4.1 I was not able to get this axis with "zero" but with "origin"

    set (gca, "xaxislocation", "origin")
like image 101
Adam Avatar answered Nov 15 '22 08:11

Adam


You can add zeroaxis with the set command:

plot(...)
set(gca, "xaxislocation", "zero")

You may also want to add:

set(gca, "box", "off")

There is a similar discussion on the octave mailinglist.

like image 44
Thor Avatar answered Nov 15 '22 10:11

Thor