3

I have a figure which uses pattern. The same behavior I notice with one of the examples of pgfplots, http://pgfplots.sourceforge.net/pgfplots.pdf page 211.

When I use envince everything looks normal see this image

enter image description here

But when I want to use pdfpc (see Is there a specialized Pdf viewer for Latex-Beamer presentations on Linux?) to give a presentation, I get the following figure

enter image description here

Is this solvable? By either editing the tikz code a bit or by pdfpc? I guess the problem lies with pdfpc which probably uses a different pdf renderer.

I also tried compiling the plot seperatly using the \documentclass{standalone} and then embed the figure .pdf into the presentation. This leads however to the same result.

The only result which I see if it cannot be fixed by either editing the code or being able to do something with pdfpc is by saving the figure as a .png or .jpg. I however rather not want to do that. Since I embed most of my tikz figures directly in my presentation such that I can animate them using \only and \onslide.

However maybe there are some other solutions? Maybe using a different pattern?

I hope someone can help me with this.

The code:

\documentclass{beamer}
\usepackage{pgfplots}
\usetikzlibrary{patterns}
\pgfplotsset{compat=newest}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\begin{axis}[area legend,
axis x line=bottom,
axis y line=left,
domain=0:1,
legend style={at={(0.03,0.97)},
anchor=north west},
axis on top,xmin=0]
\addplot[pattern=crosshatch dots,
pattern color=blue,draw=blue,
samples=500]
{sqrt(x)} \closedcycle;
\addplot[pattern=crosshatch,
pattern color=blue!30!white,
draw=blue!30!white]
{x^2} \closedcycle;
\addplot[red,line legend] coordinates {(0,0) (1,1)};
\legend{$\sqrt x$,$x^2$,$x$}
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}

-- Edit --

I believe the problem is with a pdf library which I have installed or the graphics driver. On a different laptop, which has ubuntu 12.04 (I have ubuntu 14.04) there is no problem...

1 Answer 1

2

I had the same problem, patterns that were supposed to be clipped. I found that after updating from the stable version in my distribution's repos (pdfpc-3.1.1) to the most current version (4.0.3) this was resolved. I could not find the relevant issue in their bug tracker.

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.