# pgfplots: Explicitly Setting 'Line and Mark Intersection' In Plot

Is there a way to specify where a line intersects a 'mark' on a pgfplot?

MWE:

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{figure}\begin{tikzpicture}
\begin{axis}[ enlarge x limits=0.25, enlarge y limits=0.25 ]
1.00  1.0
5.00  2.0 };
\end{axis}
\end{tikzpicture} \end{figure}
\end{document}


This produces

What I'd Like

So, in summary, is there a way to explicitly specify where a line which connects two marks on a pgfplot intersects with the mark other than at the 'center'? I'm more interested in right/left hand side intersections but any additional insight into top/bottom intersections as well as 'anywhere in between' is welcomed.

Real world application (by request):

Many examples of reaction pathway or reaction coordinate plots exist in the sciences. These usually involve plotting points on an energy graph (y-axis) vs. some pre-defined reaction coordinate (x-axis). Sometimes it is beneficial to use line marks (rather than circles or squares etc.) because text can be readily added above and/or below the lines to denote certain things like the name of the structure at that point on the graph. Lines are used to indicate the connectivity of various points on the graph in a physical sense. That is, two structures (i.e. points) are indeed connected on a potential energy surface as determined via some intrinsic reaction coordinate analysis.

The problem with my current working example lies with the fact that the line intersects with the 'line marks' at the center. This causes problems when inserting text above and/or below these lines. By offsetting this 'intersection' (as seen in the second figure), the problem ceases to exist while retaining the benefit of illustrating 'connectivity' between two points.

• Could you provide some detail about what the "real world" application" of this is? (It makes it more satisfying to work on a solution) – Jake Jun 4 '14 at 19:27
• @Jake I hope my edit satisfactorily addresses your concern. – LordStryker Jun 4 '14 at 19:41
• Possible, yes. Easy, no. For example, you could use a separate \addplot for each mark. – John Kormylo Jun 5 '14 at 12:55
• @JohnKormylo I can just draw lines and manually set coordinates that positing them properly. I figured that a more appropriate solution would be readily available. I suppose I can delete this post and use the less-preferred workaround. – LordStryker Jun 5 '14 at 14:25

I wouldn't use pgfplots for this. I think the endiagram package by Cle­mens Nieder­berger has already all features included that you need. Here I just show two examples copied from the manual, but of course you can combine the features as you like ...

\documentclass[border=2pt]{standalone}
\usepackage{endiagram}
\usepackage{chemmacros}
\DeclareSIUnit{\calory}{cal}
\sisetup{per-mode = fraction}
\begin{document}
% ---------------------------------------------------------------------
% copied from the endiagram' manual section 9 (page 24f in v0.1d)
% (needs the package chemmacros')
\begin{endiagram}
\ENcurve{1,5,2,3,0}
\ShowNiveaus[length=2,niveau={N1-2,N1-3,N1-4}]
\node[above,xshift=4pt] at (N1-2) {[\"UZ1]$^{\transitionstatesymbol}$} ;
\node[below] at (N1-3) {ZZ} ;
\node[above,xshift=4pt] at (N1-4) {[\"UZ2]$^{\transitionstatesymbol}$} ;
\end{endiagram}
\begin{endiagram}
\ENcurve{2,3,0}
\draw[<-,red] (N1-2) -- ++(2,1) node[right] {transition state} ;
\end{endiagram}
% ---------------------------------------------------------------------
% copied from the endiagram manual section 11.2 (page 32f in v0.1d)
% (needs the package chemmacros')
\ENsetup{
energy-step           = 100,
energy-unit           = \kilo\calory\per\mole,
energy-unit-separator = { in },
y-label               = above,
}
\begin{endiagram}[
scale=1.5,
calculate=false,
]
\ENcurve{2.232,4.174,.308}
\ShowEa[label,connect={draw=none}]
\ShowGain[label]
\end{endiagram}
% ---------------------------------------------------------------------
\end{document}


Setphan's answer above helped me immensely when building the potential energy diagram for the Chemistry class. I used additional options to comply with the format required in the course, so here is the result:

\documentclass[border=2pt]{standalone}
\usepackage{endiagram}
\usepackage{chemmacros}
\begin{document}

\begin{endiagram}[
y-label-text={\footnotesize Potential energy}
,x-label-text={\footnotesize Reaction progress}
,scale=1.2
]
\ENcurve[looseness=0.8,tikz={thick}]{0,2,1,4,2,7,4,6,5}
\ShowEa[label,connect={draw=none},from={(N1-1) to (N1-2)}]
\ShowEa[label,connect={draw=none},from={(N1-3) to (N1-4)}]
\ShowEa[label,connect={draw=none},from={(N1-5) to (N1-6)}]
\ShowEa[label,connect={draw=none},from={(N1-7) to (N1-8)}]
\ShowNiveaus[length=2,niveau={N1-1,N1-3,N1-5,N1-7},shift={1}]
\ShowNiveaus[length=1.5,niveau={N1-1},shift={-0.75},tikz={thick}]
\ShowNiveaus[length=1.5,niveau={N1-9},shift={0.75},tikz={thick}]
\node[above,xshift=4pt] at (N1-2) {AC} ;
\node[below] at (N1-3) {RI} ;
\node[above,xshift=4pt] at (N1-4) {AC} ;
\node[below] at (N1-5) {RI} ;
\node[above,xshift=4pt] at (N1-6) {AC} ;
\node[below] at (N1-7) {RI} ;
\node[above,xshift=4pt] at (N1-8) {AC} ;
\end{endiagram}
\end{document}
`