# How to change the values of an axis in a ListLinePlot

So, I have a plot similar to this one.

x = RandomReal[{0.5, 1}, 19]
y = RandomReal[{0.5, 1}, 19]

ListLinePlot[{y/Max[y], x/Max[x]}, PlotRange -> {{0, 19}, {0.4, 1}},
PlotStyle -> {"97", Red}, PlotRangeClipping -> False,
PlotMarkers -> Automatic, Ticks -> {Automatic, Automatic},
AxesLabel -> {"Bias Coefficient", "Normalized Value"}]


What I would like to do is to change the values shown in the x axis to the normalized "Normalized Value" that were used to generate the lists in the first place (the values of X and Y at the sample code are dummies), which I would like to input by hand.

• Perhaps you can replace the PlotRange option with the option DataRange -> {0, 1}? – Carl Woll Aug 2 '18 at 20:34

It's hard to understand what you want, it's possible that such code

x = RandomReal[{0.5, 1}, 19];
y = RandomReal[{0.5, 1}, 19];
z = {Table[{i/Length[y], y[[i]]/Max[y]}, {i, 1, Length[y]}],
Table[{i/Length[x], x[[i]]/Max[x]}, {i, 1, Length[x]}]};
ListLinePlot[z, PlotRange -> Automatic, PlotStyle -> {"97", Red},
PlotRangeClipping -> False, PlotMarkers -> Automatic,
Ticks -> {Automatic, Automatic},
AxesLabel -> {"Bias Coefficient", "Normalized Value"}]


As suggested in a great comment, I would also use DataRange, as it is less extra code, than defining your own x-vector as did Alex. However, the code of Alex allows you to do also many other things.

x = RandomReal[{0.5, 1}, 19]
y = RandomReal[{0.5, 1}, 19]

ListLinePlot[{y/Max[y], x/Max[x]}, PlotRange -> {{0, 1}, {0.4, 1}},
DataRange -> {0, 1}, PlotStyle -> {"97", Red},
PlotRangeClipping -> False, PlotMarkers -> Automatic,
Ticks -> {Automatic, Automatic},
AxesLabel -> {"Bias Coefficient", "Normalized Value"}]


Note, that I also updated the PlotRange.

But it is little bit unclear what you wanted to do. As you have labeled your two vectors x and y, perhaps this was your goal?

x = RandomReal[{0.5, 1}, 19]
y = RandomReal[{0.5, 1}, 19]

ListPlot[Transpose[{x/Max[x], y/Max[y]}],
PlotRange -> {{0, 1}, {0.4, 1}}, DataRange -> {0, 1},
PlotStyle -> {"97", Red}, PlotRangeClipping -> False,
AxesLabel -> {"Normalized Value", "Bias Coefficient"}]