I am plotting something in Octave and it is necessary to have the x axis on the top.
But this way, the title will overlay the axis label. Is there some way to change the position of the title?
I tried to save the title as a graphics handle and change it that way, but it didn't work.
This is a code example for my plot:
x = 0:0.1:2*pi;
y = sin(x);
plot(x,y)
box off
xlabel("x")
ylabel("sin(x)")
set(gca, "XDir", "Reverse")
set(gca, "YDir", "Reverse")
set(gca, "XAxisLocation", "top")
set(gca, "YAxisLocation", "right")
t = title("Sin(x)", "fontsize", 14);
Thanks!
You can to use the text
function...
x = -10:0.1:10;
plot(x, sin (x));
xlabel("x");
ylabel("sin (x)");
text(0, 1.08, "My Plot Title",
"fontsize", 20,
"color", [50, 230, 120]/255,
"horizontalalignment", "center");