Menu

#23 'name path global' is not available for \draw in 'axis'

closed
nobody
None
5
2010-10-13
2010-10-12
DJ
No

Hi Christian,

I just found that the key 'name path global' doesn't work for the \draw command in the 'axis' environment. For example, the code

<code>
...
\usepackage{pgfplots}

\usetikzlibrary{intersections}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}

\pgfplotsset{width=7cm,compat=newest}

...

% Preamble: \pgfplotsset{width=7cm,compat=newest}
\begin{tikzpicture}
\begin{axis}
\addplot [name path global=curve1] {0};
\addplot [name path global=curve2] {-5*x^3 - x^2};
\draw [name path global=curve3] (axis cs:-5, -200) -- (axis cs:5, 200);

%% !!! This works !!!
\fill [name intersections={of=curve1 and curve2, by=pt1}, red]
(pt1) circle (2pt);

%% !!! This DOES NOT work !!!
\fill [name intersections={of=curve1 and curve3, by=pt2}, red]
(pt2) circle (2pt);

\end{axis}
\end{tikzpicture}
...
</code>

The error message is
-------
Latex Error: ./test.tex:44 Package tikz Error: I do not know the path named `curve3'. Perhaps you misspelt it.

See the tikz package documentation for explanation. Type H for immediate help. ... l.44 \end{axis}
Latex Error: ./test.tex:44 Package pgf Error: No shape named pt2 is known.
See the pgf package documentation for explanation.
------

I was using pgfplot (v 1.4.1), pgf cvs 2.00 (2010/09/28)

Thanks
Dazhi

Discussion

  • Christian Feuersänger

    • status: open --> closed
     
  • Christian Feuersänger

    Hi Dazhi,

    thanks for this bug report! I investigated the problem and found strange things in the implementation of 'name path global' (i.e. in the intersection lib).

    I have just submitted a bugfix to pgf CVS; your example now compiles fine. In case you have more documents with 'name path global', I'd be glad if you could rerun them to see if there are any problems.

    Best regards

    Christian

     
MongoDB Logo MongoDB