Code: Select all
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage[italian]{babel}
\usepackage[
a4paper,
margin=15mm,
bindingoffset=2mm,
heightrounded,
]{geometry}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{float}
\usepackage{pgfplots}
\usepackage{xcolor}
\usepgfplotslibrary{external}
\tikzexternalize
\definecolor{gold}{HTML}{FFBF18}
\pgfplotsset{width=7cm,compat=1.14}
\pgfplotsset{
colormap={redyellow}{rgb255(0cm)=(255,0,0); rgb255(1cm)=(255,255,0)}
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=12cm,
xmin=0, xmax=21,
ymin=0, ymax=14,
xlabel=ml,
ylabel=pH,
xmajorgrids=true,
ymajorgrids=true,
grid style=dashed,
ytick={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14},
xtick={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20},
]
\addplot[mark=none,ultra thick,
mesh, % Use line segments instead of one unbroken line
colormap={}{ % Define the colormap
[1cm] color(0cm)=(red) color(1cm)=(gold)
},
]
coordinates {
(1,3.61)(2,3.99)(3,4.16)(4,4.33)
(5,4.52)(6,4.64)(7,4.80)(8,4.91)(9,5.06)
(10,5.24)(10.5,5.38)(11,5.49)(11.5,5.67)(12,5.82)(12.2,5.99)(12.4,6.09)
(12.6,6.46)(12.8,6.98)(13,7.35)(13.2,10.92)(13.4,11.22)(13.6,11.37)(13.8,11.50)
(14,11.58)(14.5,11.78)(15,11.83)(15.5,11.91)
(16,11.97)(17,12.08)(18,12.13)(19,12.18)(20,12.22)
};
\end{axis}
\end{tikzpicture}
\end{document}

Thanks in advance