x>0
私は、確率密度関数を持つ 2 つのパラメータ α と β で定義されるベータプライム分布をプロットしようとしています。
次のようなグラフをプロットしようとしています:
見るhttps://en.wikipedia.org/wiki/ベータプライム配布
これまでのところ、次のものがあります:
cycle list name
この質問に示されているように使用していますが、色が機能しません-pgfplots 線の色
MWE:
\documentclass[a4paper]{article}
\usepackage{pgfplots}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
%
xmin=0,xmax=5,
ymin=0,ymax=2,
cycle list name = auto,
samples=100]
\foreach \A/\B/\C in {%
1/1/1,
1/2/0.5,
2/1/0.5,
2/2/0.1667,
2/3/0.0833,
5/3/0.009524}{%
\addplot[domain=0:5] {((x^(\A-1))*(1+x)^(-\A-\B))/\C};
}
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
答え1
色のサイクルを挿入すれば可能だと思います。こちらが修正した MWE です。記号は私%<------
が追加したものに対応しています。
\documentclass[a4paper]{article}
\usepackage{pgfplots}
\pgfplotscreateplotcyclelist{fycle}{% %<------
{blue}, %<------
{orange},%<------
{red},%<------
{green},%<------
}%<------
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
%
xmin=0,xmax=5,
ymin=0,ymax=2,
cycle list name = fycle,
samples=100]
\foreach \A/\B/\C in {%
1/1/1,
1/2/0.5,
2/1/0.5,
2/2/0.1667,
2/3/0.0833,
5/3/0.009524}{%
\addplot+[domain=0:5] {((x^(\A-1))*(1+x)^(-\A-\B))/\C};%<------ only %\addplot+
}
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}