Drawing a line from one axis to another

View: New views
3 Messages — Rating Filter:   Alert me  

Drawing a line from one axis to another

by leon-9 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there,

In the following example,

\documentclass{minimal}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[name=axis1]
    \addplot coordinates {
      (0.1,0.2)
      (1.1,1.2)
    };
  \end{axis}
  \begin{axis}[at={(axis1.east)},anchor=west,xshift=1cm]
    \addplot coordinates {
      (0.1,0.2)
      (1.1,1.2)
    };
  \end{axis}
\end{tikzpicture}
\end{document}

How to draw a line between a point on the first axis to the second one?
Thank you very much.

Best wishes,
Leo


--
Emacs uptime: 47 days, 0 hours, 53 minutes, 11 seconds


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Drawing a line from one axis to another

by leon-9 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2009-11-08 09:39 +0000, Leo wrote:
> How to draw a line between a point on the first axis to the second
> one? Thank you very much.

I tried placing a named coordinate inside one axis and using it in
another. It failed.

Miraculously I can use the coordinate outside axis env. So I have
reached the following solution:

\documentclass{minimal}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[name=axis1]
    \addplot coordinates {
      (0.1,0.2)
      (1.1,1.2)
    };
    \coordinate (A) at (rel axis cs:0.2,0.2);
  \end{axis}
  \begin{axis}[at={(axis1.east)},anchor=west,xshift=1cm]
    \addplot coordinates {
      (0.1,0.2)
      (1.1,1.2)
    };
    \coordinate (B) at (rel axis cs:0.2,0.2);
  \end{axis}
  \draw (A) -- (B);
\end{tikzpicture}
\end{document}

Leo


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Drawing a line from one axis to another

by Sebastián PEÑA SALDARRIAGA :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Leo,

This is the only solution I can think of. The same has been done in this
example :
http://sourceforge.net/mailarchive/message.php?msg_name=005b01ca1475%24f6c2ef60%24e448ce20%24%40net

Sebastian

Leo a écrit :

> On 2009-11-08 09:39 +0000, Leo wrote:
>  
>> How to draw a line between a point on the first axis to the second
>> one? Thank you very much.
>>    
>
> I tried placing a named coordinate inside one axis and using it in
> another. It failed.
>
> Miraculously I can use the coordinate outside axis env. So I have
> reached the following solution:
>
> \documentclass{minimal}
> \usepackage{pgfplots}
> \begin{document}
> \begin{tikzpicture}
>   \begin{axis}[name=axis1]
>     \addplot coordinates {
>       (0.1,0.2)
>       (1.1,1.2)
>     };
>     \coordinate (A) at (rel axis cs:0.2,0.2);
>   \end{axis}
>   \begin{axis}[at={(axis1.east)},anchor=west,xshift=1cm]
>     \addplot coordinates {
>       (0.1,0.2)
>       (1.1,1.2)
>     };
>     \coordinate (B) at (rel axis cs:0.2,0.2);
>   \end{axis}
>   \draw (A) -- (B);
> \end{tikzpicture}
> \end{document}
>
> Leo
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> pgf-users mailing list
> pgf-users@...
> https://lists.sourceforge.net/lists/listinfo/pgf-users
>  


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users