Re: ShowLegend error
- To: mathgroup at smc.vnet.net
- Subject: [mg78992] Re: ShowLegend error
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sun, 15 Jul 2007 01:05:30 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <f79r9g$3hl$1@smc.vnet.net>
Maarten van der Burgt wrote:
> Dear All,
>
> The following piece of code in Mathematica 6.0
>
> <<PlotLegends`
> ShowLegend[ArrayPlot[Table[Sin[x y],{x,-2,2,.1},{y,-2,2,.1}],PlotRange->
> {-1,1}],{GrayLevel,20," -1","+1"}]
>
> does generate the graphics expected: an arrayplot with the correct legend.
>
> But is also generates this error:
>
> Ticks::ticks: {None,None} is not a valid tick specification. >>
>
> which is repeated a few times.
>
> Does anyone know where the problem lies, in de code?, in mathematica 6?
For some reasons *ShowLegend* seems to mismanaged ticks specifications
(see below a similar example with *MatrixPlot* rather than *ArrayPlot*).
In the case of *ArrayPlot*, using a transformation rule, you can easily
change the wrong tick specification {None, None} by None (although I
admit that this fails short to explain anything about this weird behavior).
<< "PlotLegends`"
ShowLegend[ArrayPlot[Table[Sin[x*y], {x, -2, 2, 0.1}, {y, -2, 2, 0.1}],
PlotRange -> {-1, 1}] /. {None, None} -> None,
{GrayLevel, 20, " -1", "+1"}, Ticks -> Automatic]
[... graphic deleted ...]
ShowLegend[MatrixPlot[Table[Sin[x*y], {x, -2, 2, 0.1},
{y, -2, 2, 0.1}]], {Hue, 20, " -1", "+1"}]
Ticks::ticks: \
{{{40.5,1},{31.5,10},{21.5,20},{11.5,30},{0.5,41}},{{40.5,1},{31.5,10}\
,<<1>>,{11.5,30},{0.5,41}}} is not a valid tick specification. >>
[... more error messages and graphic deleted ...]
Regards,
Jean-Marc
> Thanks for your help,
>
>
> Maarten van der Burgt
> Leuven, Belgium