10
$\begingroup$

Bug introduced in 10.0 and fixed in 10.3


It appears that perhaps the iterator variable r is not Block-ed in the ParametricPlot code below. This does not happen with other Plot* commands nor with Table. The plot is produced successfully, however.

r = {0., 0.5, 1.};
ParametricPlot[r {Cos[t], Sin[t]}, {r, 0, 1}, {t, 0, 2 Pi}]

Thread::tdlen: Objects of unequal length in {0.,0.5,1.} {Cos[t],Sin[t]} cannot be combined. >>

Am I doing something wrong, or is it a bug?

This happens in V10.0.2 and V10.1 (Mac OSX). It does not happen in V9. I came across this in my answer to How to make a ArrayPlot/MatrixPlot in polar coordinates?.

$\endgroup$
  • 4
    $\begingroup$ It's not a bug. It's a feature called "A New Kind of r" $\endgroup$ – Dr. belisarius Apr 14 '15 at 3:02
  • 1
    $\begingroup$ I say it's a bug, introduced in v10. v9 is fine. I'm going to add the tag. Can you report it? Note that Evaluated -> False doesn't fix it, but (very weirdly!) Evaluated -> True does! Exactly the opposite of what I would expect. $\endgroup$ – Szabolcs Apr 14 '15 at 3:19
  • $\begingroup$ @Szabolcs I've reported it to WRI. $\endgroup$ – Michael E2 Apr 14 '15 at 3:29
  • 1
    $\begingroup$ In v9 this doesn't print but in v10 it does: x := Print["x!"]; Plot[x, {x, 0, 1}]. $\endgroup$ – Szabolcs Apr 14 '15 at 3:55
  • 1
    $\begingroup$ @Szabolcs These are not equivalent, given r = {0., 0.5, 1.}: Plot[r^2 {2, 3}, {r, 0, 1}, Evaluated -> True] and Plot[Evaluate[r^2 {2, 3}], {r, 0, 1}]. I think they should be. I don't know if that's the same bug or even a bug. Evaluated is no longer documented, it seems, so WRI could argue that the discrepancy is unimportant. $\endgroup$ – Michael E2 Apr 14 '15 at 11:39
5
$\begingroup$

I assume it is a bug based on the following findings:

  • In v9.0.1 it does not happen.

  • Adding Evaluated -> False does not fix it. Strangely Evaluated -> True does fix it.

  • As you mention, other plotting functions, such as ParametricPlot3D, do not have this problem, regardless of the Evaluated setting.

This is not an answer, just some arguments on why I think it is a bug.

$\endgroup$
  • $\begingroup$ Bug, yes. But, I don't think it's serious as the plotting functions still work, so it is slight evaluation leak. $\endgroup$ – rcollyer Apr 14 '15 at 20:20
  • $\begingroup$ @rcollyer What about the x := Print["x!"]; Plot[x, {x, 0, 1}] example (which is slightly different)? In v9 it doesn't leak at all. $\endgroup$ – Szabolcs Apr 14 '15 at 20:25
  • $\begingroup$ Right. I was including that. It only prints once, implying the leak is a one time affair; the plot is otherwise unaffected. So, annoying, but not serious. $\endgroup$ – rcollyer Apr 14 '15 at 20:29
  • $\begingroup$ @rcollyer Agreed, just wanted to check it's really a bug. $\endgroup$ – Szabolcs Apr 14 '15 at 20:38
  • $\begingroup$ @Szabolcs, Dear Szabolcs, your package MaTex has the V10 syntax <||>, so I'd like to know that how to revise it to make this package could be applied in the ealier version. Thanks:) $\endgroup$ – xyz Apr 15 '15 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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