# Specify xtick/ytick with multiplication in Pgfplots

I often use plots with a second x/y-axis which is proportionally related to the first one. Therefore, I would like to calculate the tick-values by multiplication. Let's say the first one is a time and the second one a related distance, then I would like to have something like:

\begin{tikzpicture}

\begin{axis}[%
xmin=0,
xmax=1,
ymin=0*50,
ymax=1*50, % here it works
ytick = {0, .2, .4, .6, .8, 1} * 50, % this does not work
%ytick = {0, 10, 20, 30, 40, 50}, % this works, but it requires manual calculation
ylabel = {distance},
axis x line=none,
axis y line*=right,
]
\end{axis}

\begin{axis}[%
xmin = 0,
xmax = 1,
ymin=0,
ymax=1,
ytick = {0, .2, .4, .6, .8, 1},
ylabel={time},
]

\end{axis}

\end{tikzpicture}%


I would like just to copy the ytick-values from the one axis to the second one and specify the factor. Is this possible somehow? Thank in advance.

The easy solution is to NOT specify the tick list. ymin and ymax will do.

In any case, one can construct a list of scaled values using a foreach loop.

\documentclass{article}
\usepackage{pgfplots}
\usetikzlibrary{arrows.meta}

\newcommand{\yticklist}{}% reserve global name

\begin{document}

\begin{tikzpicture}

\let\yticklist=\empty% create scaled list
\foreach \y in {0, .2, .4, .6, .8, 1}
{
\pgfmathmultiply{\y}{50}%
\ifx\empty\yticklist\relax \xdef\yticklist{\pgfmathresult}%
\else \xdef\yticklist{\yticklist,\pgfmathresult}%
\fi
}
\begin{axis}[%
xmin=0,
xmax=1,
ymin=0*50,
ymax=1*50, % here it works
ytick/.expanded = {\yticklist},
axis x line=none,
axis y line=right,
y axis line style={-Butt Cap},
ylabel = {distance},
]
\end{axis}

\begin{axis}[%
xmin = 0,
xmax = 1,
ymin=0,
ymax=1,
ytick = {0, .2, .4, .6, .8, 1},
ylabel={time}
]

\end{axis}