Group Abstract Group Abstract

Message Boards Message Boards

1
|
5.1K Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

Small but annoying bug in PlotLegends/ListContourPlot

Posted 12 years ago

The following code:

grid1 = ConstantArray[0.0, {8, 8}];
ListContourPlot[grid1,
 PlotLegends -> Automatic
 ]

...produces a blank plot, as it should, but throws an error MapThread is not a Graphics primitive or directive. when attempting to produce a legend. The problem, obviously, is that there's no variation in the data. Of course I can work around this, with something like:

Block[{range},
 range = Max[grid1] - Min[grid1];
 ListContourPlot[grid1,
  PlotLegends -> If[range <= 0.0, None, Automatic]
  ]
 ]

...but it would be nice if Mathematica 10 handled the edge case gracefully. Mathematica 9 did.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard
Be respectful. Review our Community Guidelines to understand your role and responsibilities. Community Terms of Use