# Problem when using pgfplots and pgfornament

I am trying to solve a peculiar problem, but until now no success. Here is the issue:

1. I am writing a long document (a thesis) which consists of plots, decorations, and tables.
2. When I plot the graph using pgfplots, I get the plot as below:

3. But when I include the pgfornament package, then I get the following plot:

Here are the list of included packages before using pgfornament, and which gives the correct plot.

\documentclass[12pt,english]{report}
\usepackage{setspace}
\usepackage{babel}
\usepackage{buthesis}
\usepackage{amsmath,amssymb,graphicx,amsfonts,amsthm}
\usepackage{verbatim}
\usepackage{epsfig}
\usepackage{wrapfig}
\usepackage{latexsym,amsfonts,amscd}
\usepackage{changebar}
\usepackage{enumerate}
\usepackage{tikz}
\usetikzlibrary{decorations}
\usepackage{pgfplots}
\pgfplotsset{compat=1.3}

% Used only for example text
\usepackage{lipsum}

\usepackage[footnotesize,bf]{caption}  % Reduces caption font sizes

\usepackage[Bjarne]{ThesisFncychap}
\include{BjarneThesisTitles}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%-----------------------------------------------------------------
%% figures, and list of tables
\usepackage[titles]{tocloft}

\setlength{\cftbeforechapskip}{-1ex}
\setlength{\cftbeforesecskip}{-3.5ex}
\setlength{\cftbeforesubsecskip}{-3.5ex}
\setlength{\cftbeforetabskip}{-3.5ex}
\setlength{\cftbeforefigskip}{-3.5ex}
%-----------------------------------------------------------------

\dissertation


Below is the code that gives the scrambled plot. The only difference between the first and the code below is that I have included this line: \usepackage[object=vectorian]{pgfornament}. Also, I have about 10 plots like this which should automatically adjusted in two pages by latex. But after using the pgfornament package, the plots do not automatically adjust in two pages, but are in one page and some get hidden in the margin.

\documentclass[12pt,english]{report}
\usepackage{setspace}
\usepackage{babel}
\usepackage{buthesis}
\usepackage{amsmath,amssymb,graphicx,amsfonts,amsthm}
\usepackage{verbatim}
\usepackage{epsfig}
\usepackage{wrapfig}
\usepackage{latexsym,amsfonts,amscd}
\usepackage{changebar}
\usepackage{enumerate}
% Do you use TikZ?
\usepackage{tikz}
\usetikzlibrary{decorations}
\usepackage[object=vectorian]{pgfornament}
\usepackage{pgfplots}
\pgfplotsset{compat=1.3}

% Used only for example text
\usepackage{lipsum}

\usepackage[footnotesize,bf]{caption}  % Reduces caption font sizes

\usepackage[Bjarne]{ThesisFncychap}
\include{BjarneThesisTitles}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%-----------------------------------------------------------------
%% figures, and list of tables
\usepackage[titles]{tocloft}

%% Aesthetic spacing redefines that look nicer to me than the defaults.
\setlength{\cftbeforechapskip}{-1ex}
\setlength{\cftbeforesecskip}{-3.5ex}
\setlength{\cftbeforesubsecskip}{-3.5ex}
\setlength{\cftbeforetabskip}{-3.5ex}
\setlength{\cftbeforefigskip}{-3.5ex}
%-----------------------------------------------------------------

\dissertation

1. The word Data is ok, because I have set it myself using \centerline{Data}

Edited:

The above code is from the document on which I am working. To make the task simpler for the readers, I am posting a very simplified version of the code where the problem still persists. This can be regarded as a minimum working code.

\title{A Very Simple \LaTeXe{} Template}
\author{
}
\date{\today}

\documentclass[12pt]{report}
\usepackage[object=vectorian]{pgfornament}
\usepackage{pgfplots}
\pgfplotsset{compat=1.3}

\begin{document}
\maketitle

\pgfplotsset{grid style={dashed}}
\pgfkeys{/pgfplots/MyLineStyle/.style={samples=50, ultra thick}}
\pgfkeys{
/pgf/number format/precision=3,
/pgf/number format/fixed zerofill=true }

\pgfplotsset{
tick label style={font=\LARGE},
label style={font=\LARGE},
legend style={font=\LARGE},
title style={font=\LARGE}
}
\tikzset{every mark/.append style={scale=2}}

\centerline {\textbf{Data}}
\begin{tikzpicture}[scale=0.70]
\begin{axis}[title={Data-Segment},
xlabel=Z,
ylabel=P,
xticklabel style={/pgf/number format/fixed,
/pgf/number format/precision=0},
grid=major,
]
\addplot+[color=black,mark options={black},mark size = 2,line width=1.5pt,mark =*,style=densely dashed] coordinates {
(10,0.331)
(20,0.329)
(30,0.323)
(40,0.328)
(50,0.322)
(60,0.325)
(70,0.323)
(80,0.320)
(90,0.321)
(100,0.319)
};\label{p5}
\addplot+[color=black,mark options={black},mark size = 2,line width=1.5pt] coordinates {
(10,0.32)
(20,0.32)
(30,0.319)
(40,0.318)
(50,0.315)
(60,0.315)
(70,0.315)
(80,0.31)
(90,0.310)
(100,0.310)
};\label{p6}
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}[scale=0.70]
\begin{axis}[title={Data-Segment},
xlabel=Z,
ylabel=P,
legend style={ at={(1,0.5)},
anchor=east},
xticklabel style={/pgf/number format/fixed,
/pgf/number format/precision=0},
grid=major]
\addplot[color=black,mark options={black},mark size = 2,line width=1.5pt,mark =*,style=densely dashed] coordinates {
(10,0.331)
(20,0.329)
(30,0.323)
(40,0.328)
(50,0.322)
(60,0.325)
(70,0.323)
(80,0.320)
(90,0.321)
(100,0.319)
};
\addplot+[color=black,mark options={black},mark size = 2,line width=1.5pt,mark=square*] coordinates {
(10,0.32)
(20,0.32)
(30,0.32)
(40,0.319)
(50,0.317)
(60,0.312)
(70,0.312)
(80,0.31)
(90,0.309)
(100,0.31)
};
\end{axis}
\end{tikzpicture}
\newline
\begin{tikzpicture}[scale=0.70]
\begin{axis}[title={Data-Segment},xlabel=Z,ylabel=P,legend style={ at={(1,0.5)}, anchor=east},grid=major,xticklabel style={/pgf/number format/fixed,
/pgf/number format/precision=0},
]
\addplot[color=black,mark options={black},mark size = 2,line width=1.5pt,mark =*,style=densely dashed] coordinates {
(10,0.331)
(20,0.329)
(30,0.323)
(40,0.328)
(50,0.322)
(60,0.325)
(70,0.323)
(80,0.320)
(90,0.321)
(100,0.319)
};
\addplot+[color=black,mark options={black},mark size = 2,line width=1.5pt,mark=square*] coordinates {
(10,0.320)
(20,0.319)
(30,0.319)
(40,0.320)
(50,0.314)
(60,0.318)
(70,0.319)
(80,0.32)
(90,0.322)
(100,0.328)
};
\end{axis}
\end{tikzpicture}
\bibliographystyle{abbrv}
\bibliography{simple}

\end{document}


• It is great you've posted code but please reduce it and complete it to a Minimum Working Example i.e. a complete, small document which people can compile to reproduce the issue. I, at least, do not have ThesisFncychap and have no idea where to obtain it. In any case, reducing the code to the minimum makes it much easier for people to understand and work on the problem. – cfr May 25 '14 at 2:25
• @cfr Thanks for pointing out a shortcoming in my question. I have added a MWE now. I hope this can help the readers. – puser May 25 '14 at 2:54
• I have downloaded pgfornament from altermundus.com/pages/tkz/ornament/index.html and could not reproduce the issue. Could you verify that it is still present with the most recent version of pgfornament? – Christian Feuersänger May 30 '14 at 18:17
• @Christian: I again installed all the components of pgfornament on my system the way it has been asked in the ornaments.pdf file that comes along with the package. But the problem still remains. Although I have come up with a quick-fix solution myself whereby I obtained the eps files of those graphs using externalization commands in latex, and then embedded those eps files in my thesis using \includegraphics. But directly using the pgfplots code with pgfornament does not work for me. I am using latex on Red Hat Linux. Ver: pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6) – puser May 31 '14 at 2:44
• latex --version command gives me the following output: pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6) kpathsea version 3.5.6 Copyright 2007 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). Kpathsea is copyright 2007 Karl Berry and Olaf Weber. (...some copyright information...) Compiled with libpng 1.2.46; using libpng 1.2.49 Compiled with zlib 1.2.3; using zlib 1.2.3 Compiled with libpoppler – puser May 31 '14 at 2:45

I have managed to reproduce the issue (don't know why my approach yesterday failed).

The root cause is a bug in pgfornament.sty: it overwrites the tikz key at globally. If I uncomment pgfornament.sty:97 such that it becomes

\tikzset{%
%at/.code={\def\ornamenttopos{#1}},
options/.style={options default,#1},
ornament symmetry/.code={\def\ornamenttosymmetry{#1}},


everything works.

I suggest you file a bug report for pgfornament.sty.

• @alain-matthes FYI – Christian Feuersänger May 31 '14 at 6:56
• Thanks. I will file this as a bug report with the author of pgfornament. – puser May 31 '14 at 7:35
• Thanks Christian to find this problem. Possible is to write ornament/at/.code={\def\ornamenttopos{#1}}, instead of at/.code={\def\ornamenttopos{#1}}. Then you need to write ornament/atinstead of at if you want to use this option – Alain Matthes May 31 '14 at 9:27
• I updated the package – Alain Matthes May 31 '14 at 17:00