\filldraw を使用するとグラフが消える

\filldraw を使用するとグラフが消える

放物線を描いています。LaTeXコードはうまく動作します。しかし、コードに点を付けたい場合

\filldraw (A) circle (1pt) node[above right] {A}; 

するとグラフは消えます。コードは

\documentclass{article}

\usepackage{tikz}

\begin{document}

    \begin{tikzpicture}
        \def\a{1}
        \def\c{1}
        \def\xo{1}

        \def\xA{-7}
        \def\xB{2}
        \def\xC{7.5}

        \draw[domain=-2:4,smooth,variable=\x,blue] plot ({\x},{\a*(\x-\xo)*(\x-\xo) + \c});

        \pgfmathsetmacro{\yA}{\a*(\xA-\xo)*(\xA-\xo)+\c};
        \coordinate (A) at (\xA,\yA);

        \filldraw (A) circle (1pt) node[above right] {A};

        \draw[->] (-2,0) -- (8,0) node[right] {$x$};
        \draw[->] (0,-1) -- (0,4) node[above] {$y$};
    \end{tikzpicture}

\end{document}

ありがとう。

答え1

(-7/65)グラフから数マイル離れたポイントを追加しようとしたため、画像全体が大きくなりすぎてページに収まりませんでした。

代わりにグラフ内のポイントを使用すると、コードは正常に動作します。

\documentclass{article} 

\usepackage{tikz}

\begin{document}
    
    \begin{tikzpicture}  
        
        \def\a{1}
        \def\c{1}
        \def\xo{1}
        
        \def\xA{0} 
        \def\xB{2}
        \def\xC{7.5} 
        
        \draw[domain=-2:4,smooth,variable=\x,blue] plot ({\x},{\a*(\x-\xo)*(\x-\xo) + \c}); 
        
        \pgfmathsetmacro{\yA}{\a*(\xA-\xo)*(\xA-\xo)+\c}; 
        \coordinate (A) at (\xA,\yA);  
        
        \filldraw (A) circle (1pt) node[above right] {A}; 
    
        \draw[->] (-2,0) -- (8,0) node[right] {$x$};
        \draw[->] (0,-1) -- (0,4) node[above] {$y$};
    \end{tikzpicture} 
    
\end{document}

ここに画像の説明を入力してください

関連情報