No puedo entender cómo anular el estilo de línea del eje de "con flecha" (establecido en un estilo) a "sin flecha".
Aquí hay un MWE:
\documentclass[]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots,tikz}
\pgfplotsset{compat=newest}
\pgfplotsset{
axisStyle/.style={axis y line =left,
axis x line =bottom,
axis line style ={very thick}}
}
\begin{document}
\begin{figure}[htbc]
\centering
\begin{tikzpicture}
\begin{axis}
[ axisStyle,
axis y line=none,
axis y line*=left,
axis x line*=bottom,
ymax=5
]
\addplot[domain=-2:2] {x^2};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
Como puede ver, no funciona simplemente establecer el estilo de línea en "sin flecha" ni ayuda establecerlo primero en ninguna.
Nota: En realidad, mi estilo contiene, por supuesto, muchas más opciones, por lo que sería razonable usar el estilo y simplemente cambiar esas dos configuraciones si es posible.
Respuesta1
Para modificar el estilo de las líneas de los ejes, utilice <axis> axis line style={<styles>}
, donde <axis>
está el eje a modificar ( x
, y
, z
u omitir el estilo de todos los ejes) y <styles>
es el estilo a aplicar.
Por lo tanto, podemos usar axis line style={-}
las axis
opciones para anular axisStyle
y establecer localmente ninguna punta de flecha para la línea del eje. Aquí omití <axis>
porque solo se dibuja una línea de eje, pero el efecto es el mismo con x axis line style
.
Esas llaves seránadjuntoal estilo de línea del eje instalado actualmente, razón por la cual axis line style ={very thick}
todavía axisStyle
está vigente.
\documentclass[tikz]{standalone}
\usepackage{pgfplots,tikz}
\pgfplotsset{compat=1.12}
\pgfplotsset{
axisStyle/.style={
axis y line =left,
axis x line =bottom,
axis line style ={very thick},
}
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axisStyle,
axis line style={-},
axis y line=none,
ymax=5,
]
\addplot[domain=-2:2] {x^2};
\end{axis}
\end{tikzpicture}
\end{document}