Since the paraview legends look horrible when they appear inside a latex document, I want to replace them using Python's matplotlib and Nico's matplotlib2tikz package.
So I have compiled a python script matplotlib4colorbars, that produces a tikz file, which can then be included in a tex document. The tex part in a single file reads (you will have to download the included image img1.png to produce the output)
\documentclass[a4paper,10pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
%opening
\begin{document}
\begin{figure}
\newlength\figureheight
\newlength\figurewidth
\setlength\figureheight{8.5cm}
\setlength\figurewidth{2cm}
% \input{colorbar.tikz}
\begin{tikzpicture}
\begin{axis}[
title={$\mathbf{v_x}$},
xmin=0, xmax=0.07635,
ymin=-0.247, ymax=1.28,
axis on top,
scaled x ticks=false,
xtick={,,},
xticklabels={,,},
width=\figurewidth,
height=\figureheight
]
\addplot graphics [includegraphics cmd=\pgfimage,xmin=0, xmax=0.07635, ymin=-0.247, ymax=1.28] {img1.png};
\path [draw=black, fill opacity=0] (axis cs:13,1.28)--(axis cs:13,1.28);
\path [draw=black, fill opacity=0] (axis cs:0.07635,13)--(axis cs:0.07635,13);
\path [draw=black, fill opacity=0] (axis cs:13,-0.247)--(axis cs:13,-0.247);
\path [draw=black, fill opacity=0] (axis cs:0,13)--(axis cs:0,13);
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
and it produces , which I find more attractive than the paraview legend
However, I could not reproduce the prominent yticklabels
. So the question is, how to make that the pgfplot has the margin points as labels? And, how to make these margin labels a bit larger than the others?