# How to change the plot range of on an axis other than z in a ListPlot3D [closed]

ListPlot3D[Table[Tan[j i], {i, 0, Pi, 0.1}, {j, 0, Pi, 0.1}]]


I want to choose the plot range of y or x-axis so that for example only the right "hill" of the graph is shown. The code is just for illustration purposes. My actual plot uses a huge set of data points that take a few minutes to generate a full plot.

I tried searching the Mathematica documentation and this site, but so far no luck. I know the usage of:

DataRange >> it only change the value of axis label (or tick), but not choosing plot range

PlotRange >> it chooses z-axis range, but I want to choose x and y-axis too.

• Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. – bbgodfrey May 12 '15 at 18:18
• You must have missed it in the documentation: PlotRange -> {{xmin, xmax}, {ymin, ymax}, {zmin, zmax}}. – Histograms May 12 '15 at 18:27

In any case, PlotRange can take arguments for all three dimensions, as can be seen from its documentation; see "Details".

ListPlot3D[Table[Tan[j i], {i, 0, Pi, 0.1}, {j, 0, Pi, 0.1}],
PlotRange -> {{16, 32}, {16, 32}, {-5, 5}}]


I found an alternative. Because my data is array of values.

Example:

data = {{1, 2, 3, 4, 5, 1, 1, 1, 1}, {1, 2, 3, 4, 5, 1, 1, 1, 1}, {1,
2, 3, 4, 5, 1, 1, 1, 1}, {1, 2, 3, 4, 5, 1, 1, 1, 1}, {0, 0, 0, 0,
0, 0, 0, 0, 0}, {9, 9, 9, 9, 9, 9, 9, 9, 9}, {1, 2, 3, 4, 5, 1,
1, 1, 1}, {1, 2, 3, 4, 5, 1, 1, 1, 1}, {1, 2, 3, 4, 5, 1, 1, 1,
1}, {1, 2, 3, 4, 5, 1, 1, 1, 1}};


and each value correspond to the value in z-axis. Using part ([[...]]) can do the trick as well.

ListPlot3D[data[[1 ;; 5, 3 ;; 6]]]