i am trying to ListPlot some data extracted from the approximation of a complicated function. The minimal code is the following
pl[m_, n_] := ListPlot[f[m, n], PlotStyle -> Automatic, Frame->True, FrameTicks -> {{Automatic, None}, {{{1, m},{2,m+1},{3,m+2},{4,m+3},{5,m+4},{6,m+5},{7,m+6},{8,n}}, None}}]
The code will not run as I have not provided the function f[m,n]
here. Why the plot is defined like that? The reason is I have to generate many plots just by changing the value of m, n
.
Please look at the FrameTicks FrameTicks -> {{Automatic, None}, {{{1, m},{2,m+1},{3,m+2},{4,m+3},{5,m+4},{6,m+5},{7,m+6},{8,n}}, None}}
, where it can be seen that I want to relabel the frameticks that way. The m
value need not to be start from 1
always. The issue is if I increase the number of ticks say between 10 & 100
, I have to put 91
pairs {i,m+i-1}
(in this case) using my approach as I understand that my approach is a sort of manual.
The question is how I can adjust these ticks automatically starting from prechosen m
and ending at n
with a step size of my choice, e.g. 1 or 2 or 5
etc.
I searched on the web, but unfortunately, I didn't see any match understandable to me. Help is needed in this regard, please.
Table[{i, m + i - 1}, {i, 1, n}]
? I am not sure if I understood your rules are for generating the ticks though. $\endgroup$pl[4,15]
, how the FrameTicks can be adjusted to be of the form3, 4, 5, 6, ..., 15
? I mean to start from3
and end at15
. I need an automated code that should work forpl[6,20], pl[3,30]
etc. $\endgroup$m = 4; n = 9;
andTable[{i, If[i == m, "m" , If[i == n, "n", "m+" <> ToString[i - m] ]] }, {i, m, n} ]
could be used as x-ticks. $\endgroup$pl[m,n]
automatically? $\endgroup$