我正在尝试使用 制作一些简单的图表pgfplots
。但是,似乎有许多错误消息让我感到困惑,因为我找不到脚本中的任何错误。包含许多子图的此图还影响参考书目的编译。我收到错误消息,说我的.bib
文件有错误,但是当我从脚本中删除此图时,这些错误不存在。当我使用 .bib 文件运行它以获取参考资料时,我收到一堆Extra }, or forgotten \endgroup
错误,这些错误指向.bib
文件中据称不正确的行,但它们没有问题。有人能帮帮我吗?我在堆栈中找不到任何有帮助的先例。
下面我提供了我用于该图的代码以及我的论文的序言。如果你运行它,你会看到有许多不合理的失控参数错误以及许多Package PGF Math Error: Sorry, an internal routine of the floating
我无法理解的错误。如果你能给我一个错误位置的细分,那就太好了。
感谢
\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{pgfplots}
\usepackage{color}
\usepackage{texshade}
\usepackage{floatrow}
\usepackage{pgf-pie}
\usepackage{float}
\usepackage{pgfplotstable}
\usepackage{booktabs,rotating,adjustbox}
\usepackage{longtable}
\usepackage{setspace}
\usepackage{caption}
\captionsetup[figure]{labelfont=bf,font=scriptsize,labelfont=normalsize}
\usepackage{rotating}
\PassOptionsToPackage{export}{adjustbox}
\usepackage{ltablex}
\usepackage{pdflscape}
\usepackage{tikz}
\usepackage{titlesec}
\usepackage[labelfont=bf]{caption}
\usepackage[rightcaption]{sidecap}
\usepackage{subcaption}
\usepackage{gensymb} %greek letters
\graphicspath{{images/}{chapter01_images/}{chapter02_images/}{chapter03_images/}}
\usepackage[a4paper,width=150mm,top=20mm,bottom=20mm,bindingoffset=6mm,total={170mm,257mm}]{geometry}
\usepackage{fancyhdr}
\usepackage[backend=bibtex, style=numeric, sorting=nyt, citestyle=authoryear ]{biblatex}
\addbibresource{draft_ref.bib}
\setcounter{secnumdepth}{4}
\sidecaptionvpos{figure}{c}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO,LE]{Chapter \thechapter}
\renewcommand{\headrulewidth}{0.6pt}
\fancyfoot{}
\fancyfoot[CO,CE]{\thepage}
\fancyfoot[RO,LE]{Thesis Title}
\renewcommand{\footrulewidth}{0.6pt}
\begin{document}
\begin{figure}[h]
\begin{subfigure}[h]{1\textwidth}
\centering
\begin{tikzpicture}[trim axis left, trim axis right]
\begin{axis}[
legend pos=south west,
legend cell align={left},
ylabel = Ratio(340/380),
xlabel = Sodium(mM),
xmin=-5,
xmax=20,
xtick={-5,0,5,10,15},
xlabels={
0,
5,
10,
20};
ytick={0,0.5,1,1.5,2,2.5},
ymin=0,
ymax=2,
height=6cm,
width=10cm,
grid=none,
title = {Sodium Standard Curve},
]
\addplot table[fill=red!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.611\\
5 0.915\\
10 1.265\\
15 1.685\\
};
\addlegendentry{y=0.729x + 0.5731, R$^2$=0.93885}
\addplot+[fill=blue!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(0,0.611) +- (0.027,0.027)
(5,0.915) +- (0.035,0.035)
(10,1.265) +- (0.028,0.028)
(15,1.685) +- (0.045,0.045)
};
\end{axis}
\end{tikzpicture}
\end{subfigure}
\begin{subfigure}[]{1\textwidth}
\centering
\begin{tikzpicture}[trim axis left, trim axis right]
\begin{axis}[
legend pos=south west,
legend cell align={left},
ylabel = Ratio(340/380),
xlabel = Sodium(mM),
xmin=-5,
xmax=20,
xtick={-5,0,5,10,15},
xlabels={
0,
5,
10,
20};
ytick={0,0.5,1,1.5,2,2.5},
ymin=0,
ymax=2,
height=6cm,
width=10cm,
grid=none,
title = {HEK293 Nav1.7 stable cell line},
]
\addplot table[fill=red!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.3\\
5 0.3\\
10 0.3\\
15 0.3\\
};
\addplot+[fill=red!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(2,12.16) +- (0.0)
(0,10.57) +- (0.0)
(0,10.4) +- (0.0)
(148,10.35) +- (0.0)
(0,9.22) +- (0.0)
(26,9.54) +- (0.0)
(0,9.18) +- (0.0)
(3,9.06) +- (0.0)
(0,8.86) +- (0.0)
(17,8.39) +- (0.0)
(0,7.84) +- (0.0)
(74,7.34) +- (0.0)
(34,7.13) +- (0.0)
(35,6.96) +- (0.0)
(18,6.81) +- (0.0)
(76,6.75) +- (0.0)
(6,6.46) +- (0.0)
(446,6.38) +- (0.0)
(143,6.11) +- (0.0)
(447,5.98) +- (0.0)
(146,6.02) +- (0.0)
(55,5.99) +- (0.0)
(12,5.99) +- (0.0)
(447,5.98) +- (0.0)
(16,5.63) +- (0.0)
(0,5.54) +- (0.0)
(38,5.54) +- (0.0)
(172,5.59) +- (0.0)
(458,5.66) +- (0.0)
(4,5.39) +- (0.0)
(66,5.40) +- (0.0)
(172,5.59) +- (0.0)
(458,5.66) +- (0.0)
(4,5.39) +- (0.0)
(66,5.40) +- (0.0)
(230,5.28) +- (0.0)
(13,5.20) +- (0.0)
(68,5.23) +- (0.0)
(230,5.28) +- (0.0)
(448,512) +- (0.0)
(69,5.06) +- (0.0)
(94,4.96) +- (0.0)
(129,4.94) +- (0.0)
(342,4.96) +- (0.0)
(448,5.12) +- (0.0)
(13,5.02) +- (0.0)
(0,4.72) +- (0.0)
(7,4.66) +- (0.0)
(258,4,43) +- (0.0)
(521,4.38) +- (0.0)
(0,4.31) +- (0.0)
(24,4.41) +- (0.0)
(227,4.15) +- (0.0)
(257,4.14) +- (0.0)
(314,4.06) +- (0.0)
(6,4.22) +- (0.0)
(10,4.23) +- (0.0)
(113,4.15) +- (0.0)
(118,4.12) +- (0.0)
(201,3.98) +- (0.0)
(187,3.98) +- (0.0)
(108,4.01) +- (0.0)
(83,3.89) +- (0.0)
(35,3.77) +- (0.0)
(132,3.62) +- (0.0)
(278,8.59) +- (0.0)
(196,3.32) +- (0.0)
(227,3.27) +- (0.0)
(331,3.36) +- (0.0)
(46,3.07) +- (0.0)
(97,3.19) +- (0.0)
(196,3.32) +- (0.0)
(227,3.27) +- (0.0)
(502,3.27) +- (0.0)
(46,3.07) +- (0.0)
(120,2.88) +- (0.0)
(385,2.98) +- (0.0)
(487,3.08) +- (0.0)
(554,3.15) +- (0.0)
(560,3.12) +- (0.0)
(570,3.14) +- (0.0)
(704,2.97) +- (0.0)
(747,3.00) +- (0.0)
(1128,2.73) +- (0.0)
(1415,2.66) +- (0.0)
(1444,2.60) +- (0.0)
(120,2.88) +- (0.0)
(385,2.98) +- (0.0)
(487,3.08) +- (0.0)
(554,3.14) +- (0.0)
(522,2.98) +- (0.0)
(644,2.88) +- (0.0)
(684,2.83) +- (0.0)
(704,2.97) +- (0.0)
(684,2.83) +- (0.0)
(11,2.73) +- (0.0)
(16,2.77) +- (0.0)
(120,2.88) +- (0.0)
(497,2.94) +- (0.0)
(522,2.92) +- (0.0)
(53,2.53) +- (0.0)
(165,2.42) +- (0.0)
(470,2.41) +- (0.0)
(503,2.67) +- (0.0)
(581,2.70) +- (0.0)
(49,2.18) +- (0.0)
(421,2.35) +- (0.0)
(470,2.41) +- (0.0)
(510,2.27) +- (0.0)
(527,2.34) +- (0.0)
(540,2.33) +- (0.0)
(549,2.34) +- (0.0)
(553,2.37) +- (0.0)
(584,2.44) +- (0.0)
(641,2.39) +- (0.0)
(717,2.25) +- (0.0)
(646,2.23) +- (0.0)
(611,2.15) +- (0.0)
(622,2.11) +- (0.0)
(35,2.35) +- (0.0)
(165,2.24) +- (0.0)
(421,2.35) +- (0.0)
(510,2.27) +- (0.0)
(611,2.15) +- (0.0)
(622,2.11) +- (0.0)
(822,1.99) +- (0.0)
(649,1.69) +- (0.0)
(554,1.96) +- (0.0)
(230,2.22) +- (0.0)
(221,2.14) +- (0.0)
(229,1.97) +- (0.0)
(35,2.23) +- (0.0)
(49,2.18) +- (0.0)
(230,2.22) +- (0.0)
(221,2.14) +- (0.0)
(229,1.97) +- (0.0)
(49,2.18) +- (0.0)
(47,2.01) +- (0.0)
(2,1.93) +- (0.0)
(21,1.74) +- (0.0)
(42,1.56) +- (0.0)
(646,2.23) +- (0.0)
(2,1.93) +- (0.0)
(12,1.93) +- (0.0)
(47,2.01) +- (0.0)
(142,1.79) +- (0.0)
(42,1.59) +- (0.0)
(38,1.51) +- (0.0)
(0,1.21) +- (0.0)
(503,1.50) +- (0.0)
(533,1.48) +- (0.0)
(646,1.25) +- (0.0)
(571,1.00) +- (0.0)
(526,1.15) +- (0.0)
(516,0.57) +- (0.0)
(511,0.51) +- (0.0)
(0,0.06) +- (0.0)
(1673,0.86) +- (0.0)
(1683,0.72) +- (0.0)
};
\addplot table[fill=blue!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.4\\
5 0.4\\
10 0.4\\
15 0.4\\
};
\addplot+[fill=blue!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(0,0.611) +- (0.027,0.027)
(5,0.915) +- (0.035,0.035)
(10,1.265) +- (0.028,0.028)
(15,1.685) +- (0.045,0.045)
};
\addplot table[fill=green!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.5\\
5 0.5\\
10 0.5\\
15 0.5\\
};
\addplot+[fill=green!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(0,0.611) +- (0.027,0.027)
(5,0.915) +- (0.035,0.035)
(10,1.265) +- (0.028,0.028)
(15,1.685) +- (0.045,0.045)
};
\end{axis}
\end{tikzpicture}
\end{subfigure}
\begin{subfigure}[]{1\textwidth}
\centering
\begin{tikzpicture}[trim axis left, trim axis right]
\begin{axis}[
legend pos=south west,
legend cell align={left},
ylabel = Ratio(340/380),
xlabel = Sodium(mM),
xmin=-5,
xmax=20,
xtick={-5,0,5,10,15},
xlabels={
0,
5,
10,
20};
ytick={0,0.5,1,1.5,2,2.5},
ymin=0,
ymax=2,
height=6cm,
width=10cm,
grid=none,
title = {Dorsal Root Ganglia},
]
\addplot table[fill=red!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.3\\
5 0.3\\
10 0.3\\
15 0.3\\
};
\addplot+[fill=red!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(0,0.611) +- (0.027,0.027)
(5,0.915) +- (0.035,0.035)
(10,1.265) +- (0.028,0.028)
(15,1.685) +- (0.045,0.045)
};
\addplot table[fill=blue!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.4\\
5 0.4\\
10 0.4\\
15 0.4\\
};
\addplot+[fill=blue!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(0,0.611) +- (0.027,0.027)
(5,0.915) +- (0.035,0.035)
(10,1.265) +- (0.028,0.028)
(15,1.685) +- (0.045,0.045)
};
\addplot table[fill=green!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.5\\
5 0.5\\
10 0.5\\
15 0.5\\
};
\addplot+[fill=green!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(0,0.611) +- (0.027,0.027)
(5,0.915) +- (0.035,0.035)
(10,1.265) +- (0.028,0.028)
(15,1.685) +- (0.045,0.045)
};
\end{axis}
\end{tikzpicture}
\end{subfigure}
\caption[]{}
\end{figure}%
\end{document}
答案1
我不知道参考书目是怎么回事,但我会注意到你的pgfplots
代码中有几个错误。首先,你写了
xlabels={
..
};
你应该写的时候(我认为)
xticklabels={
..
},
键名错误,分号代替逗号。
另一个问题是,您在其中一个图中以错误的方式指定了错误(具有非常长的坐标列表的图)。您必须提供两个都x 和 y 误差,即使你只使用 y。也就是说,你需要
(x,y) +- (e_x, e_y)
不只是
(x,y) +- (e_x)
但是,对于该图,所有错误都为零,因此您可以考虑完全删除错误规范。
同一图中的另一个问题是,其中一个坐标有两个逗号,它表示
(258,4,43)
这可能是
(258,4.43)
修复了所有这些问题后,我确实得到了一个尺寸过大的错误,似乎是因为有些点远远超出了指定的范围axis
。添加到有问题restrict y to domain={-0:2}
的设置中解决了这个问题。\addplot
其他几点:我认为第一个轴上的图例条目应该是。如果您不打算为每个子图添加标题,那么您根本\addlegendentry{$y=0.729x + 0.5731$, $R^2=0.93885$}
不需要环境。我会考虑使用库中的环境。subfigure
groupplot
groupplots
pgfplots
最后,关于您的序言,请注意您正在加载caption
包两次。(您也可以跳过显式加载graphicx
、color
和pgfplots
,tikz
因为pgfplotstable
加载pgfplots
,这会加载tikz
,tikz
进而加载graphicx
和color
。)
完整代码,前导部分仅包含必要的位。输出截图如下。
\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{subcaption}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.15} % you might have to change version number if your version of pgfplots is older
\begin{document}
\begin{figure}
\begin{subfigure}[h]{1\textwidth}
\centering
\begin{tikzpicture}[trim axis left, trim axis right]
\begin{axis}[
legend pos=south west,
legend cell align={left},
ylabel = Ratio(340/380),
xlabel = Sodium(mM),
xmin=-5,
xmax=20,
xtick={-5,0,5,10,15},
xticklabels={
0,
5,
10,
20},
ytick={0,0.5,1,1.5,2,2.5},
ymin=0,
ymax=2,
height=6cm,
width=10cm,
grid=none,
title = {Sodium Standard Curve},
]
\addplot table[fill=red!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.611\\
5 0.915\\
10 1.265\\
15 1.685\\
};
\addlegendentry{$y=0.729x + 0.5731$, $R^2=0.93885$}
\addplot+[fill=blue!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(0,0.611) +- (0.027,0.027)
(5,0.915) +- (0.035,0.035)
(10,1.265) +- (0.028,0.028)
(15,1.685) +- (0.045,0.045)
};
\end{axis}
\end{tikzpicture}
\end{subfigure}
\begin{subfigure}[]{1\textwidth}
\centering
\begin{tikzpicture}[trim axis left, trim axis right]
\begin{axis}[
legend pos=south west,
legend cell align={left},
ylabel = Ratio(340/380),
xlabel = Sodium(mM),
xmin=-5,
xmax=20,
xtick={-5,0,5,10,15},
xticklabels={
0,
5,
10,
20},
ytick={0,0.5,1,1.5,2,2.5},
ymin=0,
ymax=2,
height=6cm,
width=10cm,
grid=none,
title = {HEK293 Nav1.7 stable cell line},
]
\addplot table[fill=red!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.3\\
5 0.3\\
10 0.3\\
15 0.3\\
};
\addplot+[fill=red!25,only marks,
restrict y to domain={-0:2}, % <-- added this
error bars/.cd, y dir=both,y explicit,] coordinates {
(2,12.16) +- (0,0)
(0,10.57) +- (0,0)
(0,10.4) +- (0,0)
(148,10.35) +- (0,0)
(0,9.22) +- (0,0)
(26,9.54) +- (0,0)
(0,9.18) +- (0,0)
(3,9.06) +- (0,0)
(0,8.86) +- (0,0)
(17,8.39) +- (0,0)
(0,7.84) +- (0,0)
(74,7.34) +- (0,0)
(34,7.13) +- (0,0)
(35,6.96) +- (0,0)
(18,6.81) +- (0,0)
(76,6.75) +- (0,0)
(6,6.46) +- (0,0)
(446,6.38) +- (0,0)
(143,6.11) +- (0,0)
(447,5.98) +- (0,0)
(146,6.02) +- (0,0)
(55,5.99) +- (0,0)
(12,5.99) +- (0,0)
(447,5.98) +- (0,0)
(16,5.63) +- (0,0)
(0,5.54) +- (0,0)
(38,5.54) +- (0,0)
(172,5.59) +- (0,0)
(458,5.66) +- (0,0)
(4,5.39) +- (0,0)
(66,5.40) +- (0,0)
(172,5.59) +- (0,0)
(458,5.66) +- (0,0)
(4,5.39) +- (0,0)
(66,5.40) +- (0,0)
(230,5.28) +- (0,0)
(13,5.20) +- (0,0)
(68,5.23) +- (0,0)
(230,5.28) +- (0,0)
(448,512) +- (0,0)
(69,5.06) +- (0,0)
(94,4.96) +- (0,0)
(129,4.94) +- (0,0)
(342,4.96) +- (0,0)
(448,5.12) +- (0,0)
(13,5.02) +- (0,0)
(0,4.72) +- (0,0)
(7,4.66) +- (0,0)
(258,4.43) +- (0,0)
(521,4.38) +- (0,0)
(0,4.31) +- (0,0)
(24,4.41) +- (0,0)
(227,4.15) +- (0,0)
(257,4.14) +- (0,0)
(314,4.06) +- (0,0)
(6,4.22) +- (0,0)
(10,4.23) +- (0,0)
(113,4.15) +- (0,0)
(118,4.12) +- (0,0)
(201,3.98) +- (0,0)
(187,3.98) +- (0,0)
(108,4.01) +- (0,0)
(83,3.89) +- (0,0)
(35,3.77) +- (0,0)
(132,3.62) +- (0,0)
(278,8.59) +- (0,0)
(196,3.32) +- (0,0)
(227,3.27) +- (0,0)
(331,3.36) +- (0,0)
(46,3.07) +- (0,0)
(97,3.19) +- (0,0)
(196,3.32) +- (0,0)
(227,3.27) +- (0,0)
(502,3.27) +- (0,0)
(46,3.07) +- (0,0)
(120,2.88) +- (0,0)
(385,2.98) +- (0,0)
(487,3.08) +- (0,0)
(554,3.15) +- (0,0)
(560,3.12) +- (0,0)
(570,3.14) +- (0,0)
(704,2.97) +- (0,0)
(747,3.00) +- (0,0)
(1128,2.73) +- (0,0)
(1415,2.66) +- (0,0)
(1444,2.60) +- (0,0)
(120,2.88) +- (0,0)
(385,2.98) +- (0,0)
(487,3.08) +- (0,0)
(554,3.14) +- (0,0)
(522,2.98) +- (0,0)
(644,2.88) +- (0,0)
(684,2.83) +- (0,0)
(704,2.97) +- (0,0)
(684,2.83) +- (0,0)
(11,2.73) +- (0,0)
(16,2.77) +- (0,0)
(120,2.88) +- (0,0)
(497,2.94) +- (0,0)
(522,2.92) +- (0,0)
(53,2.53) +- (0,0)
(165,2.42) +- (0,0)
(470,2.41) +- (0,0)
(503,2.67) +- (0,0)
(581,2.70) +- (0,0)
(49,2.18) +- (0,0)
(421,2.35) +- (0,0)
(470,2.41) +- (0,0)
(510,2.27) +- (0,0)
(527,2.34) +- (0,0)
(540,2.33) +- (0,0)
(549,2.34) +- (0,0)
(553,2.37) +- (0,0)
(584,2.44) +- (0,0)
(641,2.39) +- (0,0)
(717,2.25) +- (0,0)
(646,2.23) +- (0,0)
(611,2.15) +- (0,0)
(622,2.11) +- (0,0)
(35,2.35) +- (0,0)
(165,2.24) +- (0,0)
(421,2.35) +- (0,0)
(510,2.27) +- (0,0)
(611,2.15) +- (0,0)
(622,2.11) +- (0,0)
(822,1.99) +- (0,0)
(649,1.69) +- (0,0)
(554,1.96) +- (0,0)
(230,2.22) +- (0,0)
(221,2.14) +- (0,0)
(229,1.97) +- (0,0)
(35,2.23) +- (0,0)
(49,2.18) +- (0,0)
(230,2.22) +- (0,0)
(221,2.14) +- (0,0)
(229,1.97) +- (0,0)
(49,2.18) +- (0,0)
(47,2.01) +- (0,0)
(2,1.93) +- (0,0)
(21,1.74) +- (0,0)
(42,1.56) +- (0,0)
(646,2.23) +- (0,0)
(2,1.93) +- (0,0)
(12,1.93) +- (0,0)
(47,2.01) +- (0,0)
(142,1.79) +- (0,0)
(42,1.59) +- (0,0)
(38,1.51) +- (0,0)
(0,1.21) +- (0,0)
(503,1.50) +- (0,0)
(533,1.48) +- (0,0)
(646,1.25) +- (0,0)
(571,1.00) +- (0,0)
(526,1.15) +- (0,0)
(516,0.57) +- (0,0)
(511,0.51) +- (0,0)
(0,0.06) +- (0,0)
(1673,0.86) +- (0,0)
(1683,0.72) +- (0,0)
};
\addplot table[fill=blue!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.4\\
5 0.4\\
10 0.4\\
15 0.4\\
};
\addplot+[fill=blue!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(0,0.611) +- (0.027,0.027)
(5,0.915) +- (0.035,0.035)
(10,1.265) +- (0.028,0.028)
(15,1.685) +- (0.045,0.045)
};
\addplot table[fill=green!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.5\\
5 0.5\\
10 0.5\\
15 0.5\\
};
\addplot+[fill=green!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(0,0.611) +- (0.027,0.027)
(5,0.915) +- (0.035,0.035)
(10,1.265) +- (0.028,0.028)
(15,1.685) +- (0.045,0.045)
};
\end{axis}
\end{tikzpicture}
\end{subfigure}
\begin{subfigure}[]{1\textwidth}
\centering
\begin{tikzpicture}[trim axis left, trim axis right]
\begin{axis}[
legend pos=south west,
legend cell align={left},
ylabel = Ratio(340/380),
xlabel = Sodium(mM),
xmin=-5,
xmax=20,
xtick={-5,0,5,10,15},
xticklabels={
0,
5,
10,
20},
ytick={0,0.5,1,1.5,2,2.5},
ymin=0,
ymax=2,
height=6cm,
width=10cm,
grid=none,
title = {Dorsal Root Ganglia},
]
\addplot table[fill=red!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.3\\
5 0.3\\
10 0.3\\
15 0.3\\
};
\addplot+[fill=red!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(0,0.611) +- (0.027,0.027)
(5,0.915) +- (0.035,0.035)
(10,1.265) +- (0.028,0.028)
(15,1.685) +- (0.045,0.045)
};
\addplot table[fill=blue!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.4\\
5 0.4\\
10 0.4\\
15 0.4\\
};
\addplot+[fill=blue!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(0,0.611) +- (0.027,0.027)
(5,0.915) +- (0.035,0.035)
(10,1.265) +- (0.028,0.028)
(15,1.685) +- (0.045,0.045)
};
\addplot table[fill=green!25,mark=none, row sep=\\,
y={create col/linear regression={y=Y}}]
{
X Y\\
0 0.5\\
5 0.5\\
10 0.5\\
15 0.5\\
};
\addplot+[fill=green!25,only marks,error bars/.cd, y dir=both,y explicit,] coordinates {
(0,0.611) +- (0.027,0.027)
(5,0.915) +- (0.035,0.035)
(10,1.265) +- (0.028,0.028)
(15,1.685) +- (0.045,0.045)
};
\end{axis}
\end{tikzpicture}
\end{subfigure}
\caption[]{}
\end{figure}%
\end{document}