Tikz eje y línea = la marca superior no aparece

Tikz eje y línea = la marca superior no aparece

Tengo el siguiente código:

\RequirePackage{luatex85}
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usepackage{bm}
\usepackage{tikz}
\usepackage{graphicx}

\pgfplotsset{every non boxed x axis/.append style={x axis line style=-}, every non boxed y axis/.append style={y axis line style=-}}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    axis x line=top,
    axis y line=middle,
    xmin=0, xmax=1.0,
    ymin=0, ymax=1.0,
    xtick={0, 0.2, 0.4, 0.6, 0.8, 1.0},
    ytick={0, 0.2, 0.4, 0.6, 0.8, 1.0},
]
\end{axis}
\end{tikzpicture}
\end{document}

No aparece el ytick 1.0 (ni su etiqueta). ¿Cómo puedo arreglar esto?

Respuesta1

Agregue lo siguiente a su preámbulo:

\pgfplotsset{axis y line*/center/.code={%
    \def\pgfplots@yaxislinesnum{1}%
    \def\pgfplots@ytickposnum{2}%
    \let\pgfplots@yticklabel@pos\pgfutil@empty
}}

El código completo:

\RequirePackage{luatex85}
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usepackage{bm}
\usepackage{tikz}
\usepackage{graphicx}

\pgfplotsset{every non boxed x axis/.append style={x axis line style=-}, every non boxed y axis/.append style={y axis line style=-}}
\makeatletter   
\pgfplotsset{
    axis y line*/center/.code={\def\pgfplots@yaxislinesnum{1}\def\pgfplots@ytickposnum{2}\let\pgfplots@yticklabel@pos\pgfutil@empty},
}
\makeatother

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    axis x line=top,
    axis y line=middle,
    xmin=0, xmax=1.0,
    ymin=0, ymax=1.0,
    xtick={0, 0.2, 0.4, 0.6, 0.8, 1.0},
    ytick={0, 0.2, 0.4, 0.6, 0.8, 1.0},
]
\end{axis}
\end{tikzpicture}
\end{document}

Respuesta2

axis y line=leften lugar de axis y line=middle?

ingrese la descripción de la imagen aquí

\RequirePackage{luatex85}
\documentclass[tikz]{standalone}
\usepackage{pgfplots} % loads tikz, which loads graphicx
\usepackage{bm}

\pgfplotsset{every non boxed x axis/.append style={x axis line style=-}, every non boxed y axis/.append style={y axis line style=-}}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    axis x line=top,
    axis y line=left,
    xmin=0, xmax=1.0,
    ymin=0, ymax=1.0,
    xtick={0, 0.2, 0.4, 0.6, 0.8, 1.0},
    ytick={0, 0.2, 0.4, 0.6, 0.8, 1.0},
]
\end{axis}
\end{tikzpicture}
\end{document}

Respuesta3

Si comentas axis y line=middlefunciona. Si lo necesita axis y line=middle, intente agregar un poquito más al rango y. La configuración ymax=1.0000001funcionará.

información relacionada