2
$\begingroup$

I have a table of values and I'd like to use ReliefPlot to visualise. Is it possible through the plot command to limit the $x,y$ range displayed?

The help suggests PlotRange->{{1, 5}, {1, 10}} should do this, but this appears to limit the $z$ output not $x,y$.

I know I can pull out bits of the table, create a new one, then plot that, but this is rather inefficient when exploring the output.

$\endgroup$
5
  • $\begingroup$ Try PlotRange->{{1,5},{1,10}, Full} $\endgroup$
    – Edmund
    May 8, 2016 at 12:57
  • 1
    $\begingroup$ I agree that something looks strange in the ReliefPlot documentation. The example that says "Use an explicit x range and y range to focus on areas of interest" with PlotRange -> {{100, 200}, {200, 300}}looks identical to the preceeding one with PlotRange->Automatic....Could this be a bug? $\endgroup$
    – Rashid
    May 9, 2016 at 4:29
  • $\begingroup$ Thanks for the suggestion @Edmund, however for me that isn't limiting the x/y range. $\endgroup$
    – Esme_
    May 10, 2016 at 5:20
  • $\begingroup$ @Rashid I suspect it is a bug if I'm not misunderstanding what's said there. $\endgroup$
    – Esme_
    May 10, 2016 at 5:21
  • $\begingroup$ Esme, @Edmund I agree with you both that something fishy is going on here. Esme may have been missing a DataRange directive, nonetheless the documentation explicitly mentions that PlotRange should interact with the DataRange, but it doesn't in MMA 10.4.0 (Win7-64). It is funny to see that the online docs also show an incorrect output for that particular case. $\endgroup$
    – MarcoB
    May 10, 2016 at 16:25

1 Answer 1

0
$\begingroup$

I think you stumbled upon a bug in ReliefPlot.

data = Table[Sin[x] Cos[2 y] + 0.1 x, {x, -10, 10, 0.05}, {y, -10, 10, 0.05}];

ReliefPlot[data,
 DataRange -> {{-10, 10}, {-10, 10}},
 PlotRange -> {{-5, 5}, {-8, 5}, All},
 AspectRatio -> 1, Frame -> True, FrameTicks -> True
]

Mathematica graphics

According to the documentation for v. 10.4, PlotRange should "interact with DataRange", which I take to mean that one can specify a plot range using the transformed coordinated generated by the data range, rather than the row/column numbers when an explicit DataRange directive is provided.

In fact, however, this doesn't happen, as shown above. The documentation also contains seemingly contradictory results:

from docs

Although from the description one would expect the plot range of the resulting plot to be restricted, it actually isn't.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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