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

Mathematica generated plot

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.

$\endgroup$

closed as off-topic by Yves Klett, bbgodfrey, Öskå, m_goldberg, 2012rcampion May 12 '15 at 19:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Yves Klett, bbgodfrey, Öskå, m_goldberg, 2012rcampion
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ 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. $\endgroup$ – bbgodfrey May 12 '15 at 18:18
  • 2
    $\begingroup$ You must have missed it in the documentation: PlotRange -> {{xmin, xmax}, {ymin, ymax}, {zmin, zmax}}. $\endgroup$ – Histograms May 12 '15 at 18:27
3
$\begingroup$

With your code, I do not obtain your plot. Instead,

enter image description here

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}}]

enter image description here

$\endgroup$
0
$\begingroup$

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]]]
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.