Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This is a follow up question to this one: Use pgfplots \addplot plot coordinates with relative coordinates

Is it also possible to have the relative coordinates across multiple plots?

For example if I take @Jake's answer:

\begin{tikzpicture}
    \begin{axis}
        \addplot table [x = x rel, y=y rel,ignore chars=\%] {
      0 0 %absolute (0,0)
      2 2 %absolute (2,2)
      1 3 %absolute (2,2) + (1,3) = (3,5)
     };
     \addplot table [x = x rel, y=y rel,ignore chars=\%] {
      1 1 %absolute (3,5) + (1,1) = (4,6)
      2 1 %absolute (4,6) + (2,1) = (6,7)
     };
   \end{axis}
\end{tikzpicture}

Alternatively it would also suffice to be able to specify in the table that the path between two specific successive coordinates should not be drawn.

share|improve this question
1  
Can you add a little bit of background information about what you're trying to achieve? In this simple example, it's not clear why you would need two different \addplot commands, for example. –  Jake Sep 23 '12 at 18:20
    
I don't want a line between the absolute coordinates (3,5) and (4,6) in my example. So I just tried to use two \addplots –  student Sep 23 '12 at 18:21
    
Could you just manually adjust the first coordinate in the second \addplot command (in this case, using 4 6 instead of 1 1)? –  Jake Sep 23 '12 at 20:49
1  
Instead of using the pgfplotstable approach you can use \draw (axis cs: 0,0) -- ++ (axis direction cs: 2,2) -- ++ (axis direction cs:1,3) -- ++ (axis direction cs:1,1) -- ++ (axis direction cs:2,3); which allows you to delete the appropriate --. I'm not sure if this is the direction (pun intended) you want to go though... –  cmhughes Sep 23 '12 at 23:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.