user34812
user34812

Reputation: 523

Octave: Change (only) height of plot window

I made a plot using

h = figure;
x = 1:0.1:13;
plot(x, x, [';straight line;']);
print(h, 'graph.eps', '-color', '-deps', '-F:16');

which gives me

x vs. x square plot

I want to increase just the height of the plotting window. I added the pbaspect([1 2]); line:

h = figure;
x = 1:0.1:13;
plot(x, x, [';straight line;']);
pbaspect([1 2]);
print(h, 'graph.eps', '-color', '-deps', '-F:16');

but I get a messed up plot:

messed up plot after changing aspect ratio

I then changed the F:16 to F:8

h = figure;
x = 1:0.1:13;
plot(x, x, [';straight line;']);
pbaspect([1 2]);
print(h, 'graph.eps', '-color', '-deps', '-F:8');

and it works, but the resulting file still has the white margins on the sides(which you can see if you see the image below separately):

smaller plot with proper ratios

I want the final eps file to have the plot without the white margins. How can I achieve this?

The images were converted from eps to jpg using "convert graph.eps graph.jpg". However, they are meant to be used in a LaTeX document as eps images.

Upvotes: 1

Views: 709

Answers (1)

juliohm
juliohm

Reputation: 3779

If I understood your question correctly, try adding the -tight option to print:

`-loose'
`-tight'
      Force a tight or loose bounding box for eps files.  The
      default is loose.

Upvotes: 1

Related Questions