I would like to be able to change the line style within a certain section of the graph given a single addplot command. Is there any way possible to change the properties of the line style for specified sections of the x axis? I have only seen similar Q&A addressing multiple addplots to fulfill the different line style and also a nice example in which it seems the solution is by adding a draw with a different style to meet the expectations of the question.. Though, it seems that it also just adds a different plot at the end plot visualization..
My MWE is shown below with an "ugly" solution of just splitting the sections as multiple addplot commands.
\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usetikzlibrary{pgfplots.groupplots}
\begin{document}
\begin{tikzpicture}
\begin{groupplot}[
group style={
group size = 1 by 1,
},
clip=true,
enlargelimits=true,
height = 0.75\columnwidth,
width = 1\columnwidth,
axis x line = center,
axis y line = center,
xlabel={$x$},
xmin=0,
xmax=3,
xtick={0,1,2,3}
]
\nextgroupplot[ymin=0,
ymax=10,
ytick={0,2,...,10},
ylabel = {$y$}
]
\addplot[color=blue, domain = 0:1, samples=50
] {x^2};
\addplot[color=blue, dashed, domain = 1:2, samples=50
] {x^2};
\addplot[color=blue, domain = 2:3, samples=50
] {x^2};
\end{groupplot}
\end{tikzpicture}
\end{document}
Thanks in advance.

