i started using octave figures for my LaTeX-document and i am not quiet satisfied about a small detail about the output pdf:

I am using the bar-option for plotting and in the pdf the diagonals of the bars are drawn, as shown in the attached screenshot. Can someone give me a hint, if (1) this is the usual behavior (using a linux machine) or (2) how to fix this? Thanks a lot!

Octave script:

x = [1:4];
y = x;
title('testing the font');
print -depslatex  "-SX,Y" "out.tex"

Latex Document:


Out.tex generated from octave:

% Title: gl2ps_renderer figure
% Creator: GL2PS 1.3.9, (C) 1999-2015 C. Geuzaine
% For: Octave
% CreationDate: Thu Oct 12 13:37:40 2017
\selectfont\put(298.08,409.6){\makebox(0,0)[b]{\textcolor[rgb]{0,0,0}{{testing the font}}}}

output: diagonals

  • 1
    can you include the tex file? You shouldn't need resize box if it is generated by TeX. – percusse Oct 12 '17 at 11:25
  • @percusse: Thank you for your help: if i don't use the resize box i get: "Overfull \hbox (231.0pt too wide) in paragraph" Also it seems to work only with PdfLaTeX as compiler, not with the default LaTeX. – JoeBroesel Oct 12 '17 at 11:45
  • That's a warning not an error. And we can't help without seeing the contents of the out.tex file. – percusse Oct 12 '17 at 11:50
  • ah, i thought you meant include instead of input, sorry for the misunderstanding- i now edited question. Do you need the original .eps file as well? I think i can't upload it here. – JoeBroesel Oct 12 '17 at 11:59
  • I get the same output at least (Kubuntu, Octave 4.0.0), the lines are visible when viewing the EPS in Okular, but not in Evince. Try -dpdflatex instead. – Torbjørn T. Oct 12 '17 at 12:09

I get the same output, but when using the -dpdflatex driver instead of -depslatex for the print in Octave, the result looks good. Perhaps there is a difference in how the bars are rendered between the two.

Result with print -dpdflatex "-SX,Y" "out.tex":

dpdflatex bars

You can find more infos at: Manual for Plotting and Saving Plots

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.