您好,可以去除箭头所指标记上的较暗边框吗?
谢谢
\documentclass[a4paper,12pt]{article}
\usepackage{pgfplots,pgfplotstable} % Grafici
\pgfplotsset{/pgf/number format/use comma,compat=newest,%
width=12cm,%
height=9cm%
}
%*********************************************************************************
% Impostazioni Pgfplots
%*********************************************************************************
\pgfplotstableread{
X Y
0.05 0.17
0.05 0.041
0.05 0.023
0.1 0.332
0.1 0.089
0.1 0.041
0.15 0.5
0.15 0.132
0.15 0.06
}\tableA
\pgfplotstablecreatecol[linear regression]
{regression}
{\tableA}
\xdef\slope{\pgfplotstableregressiona} %<-- might be handy occasionally
\xdef\intercept{\pgfplotstableregressionb}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[/pgf/number format/fixed,
legend pos=outer north east,
grid=major,
xmin=0, xmax=0.2,
ymin=0, ymax=0.6,
point meta min={0},
point meta max={0.2},
yticklabel shift=2pt,
xticklabel shift=2pt,
legend pos=north west,
legend cell align=left,
minor tick num=4,
xticklabel style={text height=1.5ex},
xtick={0,0.05,...,0.3},
minor xtick={%
0.01,0.02,0.03,0.04,%
0.06,0.07,0.08,0.09,%
0.11,0.12,0.13,0.14,%
0.16,0.17,0.18,0.19},%
extra x ticks={0,0.05,...,0.3},
extra x tick style={
xticklabel pos=right,
xticklabel style={text depth=0pt}
},
extra y ticks={0,0.1,...,0.7},
extra y tick style={
yticklabel pos=right
},
tick style={thin,black},
xlabel=\large $m$,
ylabel=\large $\Delta l$,
colorbar horizontal,
colorbar style={
/pgf/number format/fixed,
xticklabel shift=2pt,
xtick={0,0.05,...,0.3},
xticklabel style={text height=1.5ex}
},
axis line style={draw=none}, after end axis/.append code={\draw (rel axis cs:0,0) rectangle (rel axis cs:1,1);},
colormap={new}{color(0cm)=(violet);color(1cm)=(blue);color(2cm)=(cyan);color(3cm)=(green);color(4cm)=(yellow);color(5cm)=(orange);color(6cm)=(red)}
]
\addplot [point meta=explicit,
scatter,
mark=*,
draw=none]
table[meta=X] {\tableA};
\addplot [mesh,point meta=x,domain=0.025:0.175,very thick,samples=10] {\slope*x+\intercept};
\addlegendentry{%
$\pgfmathprintnumber{\pgfplotstableregressiona} \cdot x
\pgfmathprintnumber[print sign]{\pgfplotstableregressionb}$}
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
答案1
如果要完全删除标记的边框,可以添加
scatter/use mapped color={draw opacity=0,fill=mapped color}
到您的\addplot
选项(draw=none
这里不起作用)。
如果希望边框颜色与填充颜色相同,请使用
scatter/use mapped color={draw=mapped color,fill=mapped color}