Q&A

+1
−0

# Have

This .png image of a plot:

# Want

To add vertcal lines between the groupings:
(0, 1, 2) LINE (3, 4, 5) LINE (6, 7, 8)

I want to place the lines exactly in the middle of the grouping boundaries.

The solution I envision is marking (*) the vertical edges of the bars of each grouping boundary, and then placing a line exactly between those two marks:
(0, 1, 2)* LINE *(3, 4, 5)...

# Notes

I am using Linux, and have access to Gimp. That being said, I am open to better suited software other than Gimp, as long as it's available for Linux.

Inspired by this post.

Why does this post require moderator attention?
Why should this post be closed?

+1
−0

If you have access to the source of the image, fix the code instead of messing with the image. This will be much more accurate and result in a higher quality result.

You could add the lines via latex (texlive is available via the usual linux package managers, but is often already installed because many other tools have it as dependency).

1. first determined the coordinates of the 0 and 8 x ticks (the commented green help lines in the example below). I'm using these coordinates instead of trying to determine the location of the bars, because these span a larger interval and thus the error from doing this by eye will be smaller. In the example below, they are at -16.1 and 17.45.

2. next calculate from these coordinates the location of your desired lines, -5.6158 and 6.9653.

(might be a bit overkill, but I think this will ensure that the lines are placed as precisely as possible)

\documentclass{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[inner sep=0pt,outer sep=0pt]
\node at (0,0) {\includegraphics{ULaNwNrkXuSqPYiKGbEjrzGa}};
%\draw[green,line width=5pt] (-16.1,-10.1) -- ++(0,19.9);
%\draw[green,line width=5pt] (17.45,-10.1) -- ++(0,19.9);

\draw[magenta,line width=5pt] (-5.6158,-10.1) -- ++(0,19.9);
\draw[magenta,line width=5pt] (6.9653,-10.1) -- ++(0,19.9);
\end{tikzpicture}

\end{document}


(replace ULaNwNrkXuSqPYiKGbEjrzGa with the filename of your image)

Why does this post require moderator attention?