Message Boards Message Boards

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

Small but annoying bug in PlotLegends/ListContourPlot

Posted 10 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.

Attachments:
POSTED BY: Leon Avery

Thank you for posting this. I sent the information to support@wolfram.com for reporting.

POSTED BY: Bruce Miller
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract