pgfplots で小さな関数値をプロットするにはどうすればよいでしょうか?

pgfplots で小さな関数値をプロットするにはどうすればよいでしょうか?

pgfplots で 2 つの関数を視覚化しようとしていますが、両方が同じポイントで終了するという主なメッセージを伝えることができません。できれば追加の外部ツールを使用せずに、この動作を変更するにはどうすればよいでしょうか?

ここに私の小さな例を示します:

\documentclass[tikz]{standalone}

\usepackage{tikz,pgfplots}
\pgfplotsset{compat=1.8} 

\begin{document}

\begin{tikzpicture}
\begin{axis}[
    xmin=0.0,
    xmax=2,
    ymin=0,
    ymax=1.75,
    axis x line=bottom,
    axis y line=left, 
    xlabel=control parameter $r$,
    ylabel=energy $(J)$, 
    ytick={}, yticklabels={},
    xtick={1},
    xticklabels={1},    
    restrict x to domain=0:2,
    ]   

    \addplot+[smooth,no marks, samples at={1.0,0.999,0.99,0.96,...,0.001,0}] {1.12*(1-x)^0.5};
    \addplot+[smooth, densely dashed, no marks,samples=1000]{1.75*(1-x)^0.5}; 
\end{axis} 
\end{tikzpicture}   

\end{document}

出力は次のようになります。

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

理想的には、両方の関数は正確に(1,0)で終わりますが、サンプル数が多いか、xの値を1.0に明示的に指定しても、近づくことができません。代わりにgnuplotを使用しようとしましたが、gnuplot で pfgplots の精度を向上させるpgfplots は gnuplot からの無制限の座標を破棄しないことに注意してください。

指数が正確に 1/2 の場合、 sqrt 関数はより良い結果をもたらしますが、この特殊なケースでのみ機能します。

何か案は?

答え1

sqrtゼロを 0.5 乗する代わりに関数を使用できます。

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8} 

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    xmin=0.0,
    xmax=2,
    ymin=0,
    ymax=1.75,
    axis x line=bottom,
    axis y line=left, 
    xlabel=control parameter $r$,
    ylabel=energy $(J)$, 
    ytick=\empty,
    xtick={1},
    xticklabels={1},    
    restrict x to domain=0:2,
    ]   

    \addplot+[smooth,no marks, samples at={1.0,0.999,0.99,0.96,...,0.001,0}] {1.12*sqrt(1-x)};
    \addplot+[smooth, densely dashed, no marks,samples=1000]{1.75*sqrt(1-x)}; 
\end{axis} 
\end{tikzpicture}   

\end{document}

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

関連情報