I was fiddling with how to plot raw signals to LaTeX and it turned out that there is no good solution (tikzexternalize
, R+kniter
, matlatb2tikz
are cool but exhaust TeX memory if is really raw data)... Anyway, I decided to go with MATLAB right away and export the plots as PDFs without labels or ticks, which I intended to add/draw on to of the image. Now there's the problem:
How to draw an invisible frame and tick marks?
I need the tick
s for the ticklabel
s so hide axis
is not an option. I feel that this is some pgfplot style
-thing, which is totally out of my skills.
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\node[anchor=south west,inner sep=0cm] at (0,0) {\includegraphics[width=\textwidth]{constant-plot.png}};
\begin{axis}[
scale only axis,
width = 9.65cm,
height = 7.93cm,
xshift=1.84cm,
yshift=1.47cm,
xmin=-0.1,
xmax=1.1,
ymin=0.05,
ymax=0.7,
ytick={0.2,0.4,...,0.6},
color=green,
every tick/.style={green}
]
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
I just took a png from pgfplots.net.
I have no idea if that is a proper way to link external graphics with Tex-based fonts/labeling but I don't see a different option.
R
,ggplot2
,tikzdevice
andknitr
. The resulting plots integrate well into the general layout of the document. If you mourn about long compile times you have to read theknitr
documentation more carefully.knitr
is able tocache
your chunks. If you use this feature compile times are even reduced compared to a document with lots of inline pgfplots.