2

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;
bar(x,y);
grid;
title('testing the font');
print -depslatex  "-SX,Y" "out.tex"

Latex Document:

\documentclass[10pt,a4paper]{article}
\usepackage{pgfplots}
\begin{document}
    \begin{figure}
       \centering
       \resizebox{0.9\textwidth}{!}{\input{out.tex}}
    \end{figure}
\end{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
\setlength{\unitlength}{1pt}
\begin{picture}(0,0)
\includegraphics{out-inc}
\end{picture}%
\begin{picture}(576,432)(0,0)
\fontsize{10}{0}
\selectfont\put(164.16,42.5189){\makebox(0,0)[t]{\textcolor[rgb]{0.15,0.15,0.15}{{1}}}}
\fontsize{10}{0}
\selectfont\put(253.44,42.5189){\makebox(0,0)[t]{\textcolor[rgb]{0.15,0.15,0.15}{{2}}}}
\fontsize{10}{0}
\selectfont\put(342.72,42.5189){\makebox(0,0)[t]{\textcolor[rgb]{0.15,0.15,0.15}{{3}}}}
\fontsize{10}{0}
\selectfont\put(432,42.5189){\makebox(0,0)[t]{\textcolor[rgb]{0.15,0.15,0.15}{{4}}}}
\fontsize{10}{0}
\selectfont\put(69.8755,47.52){\makebox(0,0)[r]{\textcolor[rgb]{0.15,0.15,0.15}{{0}}}}
\fontsize{10}{0}
\selectfont\put(69.8755,135.54){\makebox(0,0)[r]{\textcolor[rgb]{0.15,0.15,0.15}{{1}}}}
\fontsize{10}{0}
\selectfont\put(69.8755,223.56){\makebox(0,0)[r]{\textcolor[rgb]{0.15,0.15,0.15}{{2}}}}
\fontsize{10}{0}
\selectfont\put(69.8755,311.58){\makebox(0,0)[r]{\textcolor[rgb]{0.15,0.15,0.15}{{3}}}}
\fontsize{10}{0}
\selectfont\put(69.8755,399.6){\makebox(0,0)[r]{\textcolor[rgb]{0.15,0.15,0.15}{{4}}}}
\fontsize{11}{0}
\selectfont\put(298.08,409.6){\makebox(0,0)[b]{\textcolor[rgb]{0,0,0}{{testing the font}}}}
\end{picture}

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
1

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

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.