4

It seems I cannot use PlotLegend with ParametricPlot. Here's what I tried:

ParametricPlot[{Sin[t], Cos[Sqrt[t]]}, {t, 0, 2 Pi}, 
 PlotLegend -> {"My Plot"}] 
nos
  • 19,875
  • 27
  • 98
  • 134
  • 1
    With all respect to the closers, I am not sure they really understood the question. It would be better if people would take it more seriously and stay within the area of their competence regarding questions closing. The question might be brief, but it does not mean it is invalid. Voting for reopen. – Leonid Shifrin Oct 02 '11 at 13:08
  • @Leonid, I think the question can be improved. The addition of a code snippet and the errors that it generates would go a long way. And, it would satisfy the closers. – rcollyer Oct 02 '11 at 13:20
  • @rcollyer I agree, it can be improved. But in my view, it is also quite consistent in its current form. I don't feel like our SO mma community needs much extra help in deciding which questions should be closed, without even giving most of us a chance to look at them. The energy for moderation can be much better spent elsewhere - moderation assumes certain responsibilities, like understanding whether or not the question is real. If one can not decide - should leave it to those who can. People should stick to their areas of expertise - that's the foundation of any constructive communication. – Leonid Shifrin Oct 02 '11 at 13:36
  • I agree this was fine. The recent closure trend has me a bit perplexed. – Daniel Lichtblau Oct 02 '11 at 16:14
  • @Daniel, I think it was sufficient to be answered, but not necessarily fine. (Note, I'm one of reopen votes.) I think the use of a moderator's super close vote was excessive, though. – rcollyer Oct 02 '11 at 16:57
  • @nos, would you please add the following to your question: the errors generated and a minimal working code snippet that illustrates the problem. This will go a long way in getting the question reopened. – rcollyer Oct 02 '11 at 16:58
  • @DanielLichtblau This question was not closed by people active in the Mathematica tag. It was one random user + a ♦ moderator. It has 4 reopen votes now and soon will be opened. – abcd Oct 02 '11 at 18:08
  • 1
    @rcollyer Since OP accepted Verbeia's answer, it seems to me that not loading the package was the problem. No point in sweating over the OP returning and posting their exact snippet. I just copied over Verbeia's example sans the `Needs[...]`, so that the question and answer make sense now. – abcd Oct 02 '11 at 18:10
  • @yoda, not sweating. just didn't feel the need to the edit myself. – rcollyer Oct 02 '11 at 18:11
  • I thought about just commenting to ask if the OP had loaded the package, since it was the obvious issue. I am a bit surprised that some (non-Mma) people thought it worth closing. It wasn't the greatest question, but it was clear enough to work out the answer. It's nice to have an obvious one every now and again. – Verbeia Oct 03 '11 at 00:41
  • @Verbeia We've always had problems.. first with folks who confuse the name with "mathematics" and bring their close guns on us and others, who try to correct stuff like `ParametricPlot` in the title to `parametric plot` to make it a "proper sentence". Usually belisarius waves a stick at them and they leave after the first two votes. This time it involved a moderator closing, so it was binding after the second vote... It's good that there's enough 3k+ users in the tag to reopen. – abcd Oct 03 '11 at 04:49
  • @yoda I'll refrain from pointing out the advantages of upvoting those of us in the 2000s then ;-) – Verbeia Oct 03 '11 at 05:40
  • @Verbeia ἀριστοκρατία does not work like that! :) – Dr. belisarius Oct 08 '11 at 04:16

1 Answers1

5

If you call the PlotLegends package first, it should work, though you might be better using the ShowLegends version than the PlotLegend option, for more control:

Needs["PlotLegends`"]

ParametricPlot[{Sin[t], Cos[Sqrt[t]]}, {t, 0, 2 Pi}, 
 PlotLegend -> {"My Plot"}]

enter image description here

ShowLegend[
 ParametricPlot[{Sin[t], Cos[Sqrt[t]]}, {t, 0, 
   2 Pi}], {{{Graphics[{Blue, Disk[{0, 0}, 1]}], {Sin[t], 
     Cos[Sqrt[t]]}}}}]

enter image description here

Verbeia
  • 4,400
  • 2
  • 23
  • 44
  • And I'm going to mention as an addendum the question I asked a while ago, where the answer shows how to eliminate the borders and boxes on the legend: http://stackoverflow.com/questions/7074209/can-the-frame-border-on-a-barchart-legend-be-removed – Verbeia Oct 02 '11 at 07:34