0

\documentclass[tikz]{standalone}

\usepackage{pgfplots}
\pgfplotsset{compat=newest} % <-- Causes dancing y label when adding  'extra y ticks'

\pgfplotsset{myDefaultStyle/.style = 
    {
    width = 160mm,
    height = 90mm,
    axis x line = bottom,
    axis y line = left,
    ylabel = y Label,
    xlabel = x Label,   
    grid = major,
    }}

\begin{document}

% ######### Plot #########
% ########################
\begin{tikzpicture}
    \begin{axis}[
        myDefaultStyle,
        xmin = 0,
        xmax = 32,
        ymin = 24.5,
        ymax = 30.1,        
        xtick = {0,10,20,30},   
        ytick = {25,26,30},     
    ]
    % Plots 
    \addplot[domain=0:10,red]{x^2};     
    %   
    \end{axis}
\end{tikzpicture}

% ######### Plot #########
% ########################
\begin{tikzpicture}
    \begin{axis}[
        myDefaultStyle,
        xmin = 0,
        xmax = 32,
        ymin = 24.5,
        ymax = 30.1,        
        xtick = {0,10,20,30},   
        ytick = {25,26,30},     
        extra y ticks={25.5}, % <-- Added
    ]
    % Plots     
    \addplot[domain=0:10,red]{x^2}; 
    %
    \end{axis}
\end{tikzpicture}

\end{document}

enter image description here

  • Bug reports should of course go to https://sourceforge.net/p/pgfplots/bugs/ – Torbjørn T. Jun 16 '17 at 16:04
  • @TorbjørnT. Thanks. Actually, I have trouble logging in at the moment. Somehow my login data in invalid and I tried to do the forget your password? thing (no email so far). Would you also consider it a bug? Maybe you can copy and paste the code to sf. – Dr. Manuel Kuehner Jun 16 '17 at 16:05
  • 1
    See https://tex.stackexchange.com/a/372894/43317 and https://sourceforge.net/p/pgfplots/bugs/173/ – esdd Jun 16 '17 at 17:01

0 Answers0