I'm generating pgf plots on the fly and I would like to avoid adding non integer y ticks on my plots, while keeping all the x ticks. Here is a MWE:
\documentclass[10pt]{article}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{amssymb}
\usepackage{pgfplotstable}
\usepackage[active, pdftex, tightpage]{preview}
\PreviewEnvironment[{[]}]{tikzpicture}
\setlength\PreviewBorder{2mm}
\begin{filecontents}{PJxpGrZtwos.tex.dat}
N f M
1024 3.407938e+01 25
1536 1.339487e+01 20
2048 1.139487e+01 19
3072 8.351236e+00 14
4049 6.466788e+00 13
6144 4.466788e+00 11
\end{filecontents}
\pgfkeys{/pgf/fpu=true}
\pgfplotstableread{PJxpGrZtwos.tex.dat}\loadedtable
\pgfplotstablegetelem{0}{N}\of{\loadedtable}
\let\relativeTo\pgfplotsretval
\pgfplotstablegetelem{0}{f}\of{\loadedtable}
\let\f\pgfplotsretval
\pgfplotstablecreatecol[create col/expr={\f / \thisrow{f}}]{f-relative}\loadedtable
\pgfkeys{/pgf/fpu=false}
\begin{document}
\begin{tikzpicture}
\begin{loglogaxis}[axis y line*=left, legend pos=south east,xlabel={N},xtick=data, xticklabels from table={\loadedtable}{N},ytick=data, yticklabel=\pgfmathparse{exp(\tick)}\pgfmathprintnumber{\pgfmathresult}, ylabel ={$\dfrac{f(\pgfmathprintnumber\relativeTo)}{f(N)}$}]
\addplot[black] table[x=N, y expr=\thisrow{N}/\relativeTo] {\loadedtable};
\addplot[blue, mark=*] table[x=N, y=f-relative] {\loadedtable};
\legend{{Linear progression},}
\end{loglogaxis}
\begin{semilogxaxis}[ymin = 5, ytick={10, 15, ..., 30}, ymax = 35, axis x line=none,ylabel={\# M}, axis x line=none, axis y line*=right, ylabel near ticks=right, yticklabel pos=right]
\addplot[red, dotted, mark=x, mark options={solid}] table[x=N, y=M] {\loadedtable};
\end{semilogxaxis}
\end{tikzpicture}
\end{document}
What I would like here is to have \addplot[black] table[x=N, y expr=\thisrow{N}/\relativeTo] {\loadedtable}; not adding y ticks for non integer values of \thisrow{N}/\relativeTo while keeping all x ticks.
If you have any other way to draw a linear function from (x_min, 1) to (x_max, x_max/x_min), while having the nice corresponding y ticks (maybe by creating another table ?), that will also do the trick.
Keep in mind that this is for 'on the fly' plot generation, I don't know my value a priori, so I can't use in this case y tick={1,...,6}.

