Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2177

A Request to Fix ShowLegend

From "Kevin J. McCann" <Kevin.McCann@umbc.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject A Request to Fix ShowLegend
Date 2011-05-07 11:36 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <iq3ari$fm1$1@smc.vnet.net> (permalink)

Show all headers | View raw


Sorry for the rant, but here it is:

This has come up before in the ng, but today it is really irritating me; 
so, I thought I would bring it up again. The issue is the putting of 
legends on plots. In particular colorbars. Here is the example from the 
ShowLegend documentation:

ShowLegend[
  Plot3D[Sin[x y], {x, 0, \[Pi]}, {y, 0, \[Pi]},
   ColorFunction -> "Rainbow"], {ColorData["Rainbow"][1 - #1] &, 10,
   " 1", "-1", LegendPosition -> {1.1, -.4}}]

And, yes, it works just fine. However if you change the plotted function 
to 2 Sin[x y], you get EXACTLY the same colorbar. This is nonsense. So, 
in order to use ShowLegend, you have to do three things:

1) Do the Plot3D, or whatever the plot with its own ColorFunction;
2) As one of the arguments to ShowLegend, you define the Colorfunction, 
but it is Reversed (how awkward is that?);
3) You have to know AND specify the limits of the colorbar, i.e. these 
are just symbols and have absolutely nothing to do with the function 
values that are plotted, and these are also reversed from the "normal" 
way, i.e. "1","-1" instead of "-1","1", which is what I would have 
guessed. As I said, you could put anything for these limits.

This makes this part of the Legend suite useless or, at best, 
extraordinarily cumbersome to use.

I just wonder what the folks at Wolfram are thinking when they put out 
the software this way with two really easy ways to mess it up, i.e. (2) 
and (3) above.

Now, I know that there is a package out there, ColorbarPlots, and it 
works reasonably well and certainly makes my life easier; however it has 
some limitations, in particular for the ColorFunction choices. Shouldn't 
something like this be a part of Mathematica? Is there a good reason for 
leaving ShowLegend the way it is? I am just wondering about the logic 
here, and I am willing to admit that I might have missed something; 
however, if there isn't a good reason, maybe it is time to fix it.

Kevin

Back to comp.soft-sys.math.mathematica | Previous | NextNext in thread | Find similar | Unroll thread


Thread

A Request to Fix ShowLegend "Kevin J. McCann" <Kevin.McCann@umbc.edu> - 2011-05-07 11:36 +0000
  Re: A Request to Fix ShowLegend Peter Breitfeld <phbrf@t-online.de> - 2011-05-09 10:21 +0000
    Re: A Request to Fix ShowLegend "Kevin J. McCann" <Kevin.McCann@umbc.edu> - 2011-05-10 12:32 +0000

csiph-web