0

I am using Paraview to visualize some data. Is it possible to label the diagram taken from Paraview using the TikZ package. My knowledge about this package is limited. My labelled image would look something like:

enter image description here

Is it possible to create such a label using TikZ? If yes how can this be achieved?

Aim
  • 633

1 Answers1

1

Though multiple solutions have been proposed as noted by KersouMan. I am personally very fond of the solution proposed by Max to a closely related problem of mine. So if you like this answer please upvote his.

I added the other nodes with some comments to help you unederstand the script. Of course all of this supposes that you actually have your Paraview plot available as a graphics file (e.g. pdf, png, jpg ...)

EDIT Addition of a node connected to two arrows.

\documentclass[tikz]{standalone}
\tikzset{
    % Tikz style used to work in relative coordinates to the underlying picture
    % From https://tex.stackexchange.com/a/445311/141947
    use bounding box relative coordinates/.style={
        shift={(current bounding box.south west)},
        x={(current bounding box.south east)},
        y={(current bounding box.north west)}
    },
    % Shortcut to avoid repeating stuff afterwards
    label/.style={fill=white,draw=black},
}
\begin{document}

\begin{tikzpicture}
% Import picture and select it as bounding box
\node[use as bounding box] {\includegraphics{example-image-a}};
% Activate relative positioning of points
\begin{scope}[use bounding box relative coordinates]
    \node[label] at (0.8,0.8) {TE};
    \node[label] at (0.8,0.2) {LE};
    % Create an arrow between point at coordinates (0.2,0.4) and a point a 60° angle and 0.5 distance from the first one
    \draw[stealth-] (0.2,0.4) --++ (60:0.5) node[pos=1,label,anchor=west]{Horseshoe vortex} ;
    % Create a label, then draw arrrows linked to it
    \node[label] (IndVortLabel) at (0.3,0.3) {Induced vortices};
    \draw[] (IndVortLabel.west) edge[-stealth] (0.1,0.35)
            (IndVortLabel.west) edge[-stealth] (0.1,0.25);
\end{scope}
\end{tikzpicture}
\end{document}

enter image description here

BambOo
  • 8,801
  • 2
  • 20
  • 47
  • Dear BambOo, can you please tell the necessary changes to be made to in the \draw[stealth-] to achieve this. I am not able to figure out. – Aim Apr 28 '20 at 06:11
  • @Giri, I edited my answer. However, you should have a look at the tikz manual there are a lot of examples to show you how the package works – BambOo Apr 28 '20 at 08:28