1
$\begingroup$

Possible Duplicate:
Creating legends for plots with multiple lines?

I am trying to plot the color bar that shows the data range for the data plotted by ListPlot3D. I want to ask if I can use the ShowLegend command with the LisPlot3D? My code is as the following :

Needs["PlotLegends`"];
s = Import["C10002.xls"]
Rotate[ListPlot3D[s, PlotRange -> {0.048, 0.22}, Mesh -> None, 
  AxesLabel -> 
  Style[StandardForm[\[Phi]], FontSize -> 20, FontWeight -> "Bold"]],
  30 Degree, {0, 1, 0}]

ShowLegend[
  ListPlot3D[s, PlotRange -> {0.048, 0.22}, Mesh -> None, 
  AxesLabel -> 
  Style[StandardForm[\[Phi]], FontSize -> 20, FontWeight -> "Bold"]],
  LegendPosition -> {1.1, -.4}]

I will be very thankful for your help.

$\endgroup$
4
  • 3
    $\begingroup$ I would say this is a duplicate of mathematica.stackexchange.com/q/4025/5 Do not use the PlotLegends package... it is absolutely terrible. $\endgroup$
    – rm -rf
    Oct 16, 2012 at 5:40
  • $\begingroup$ More to the point, there is an example of a ListPlot3D in the PlotLegends documentation that shows how to use ShowLegend in that context. The main trick is to include a second argument to instruct ShowLegend what colors and data range to use, e.g. {ColorData["Rainbow"][1 - #1/0.22] &, 10, " 0", "0.22", LegendPosition -> {1.1, -0.4}}. $\endgroup$
    – Verbeia
    Oct 16, 2012 at 10:26
  • $\begingroup$ By the way, Yousef, welcome to Mathematica.SE! Please consider registering your account. That way, you can use the same account from different locations and accumulate any reputation you might gain from upvotes on your posts. $\endgroup$
    – Verbeia
    Oct 16, 2012 at 11:08
  • $\begingroup$ Verbeia Thanks so much for your comments it helped me so much ! I agree with you that PlotLegends is a poor package. $\endgroup$
    – Yousef
    Oct 16, 2012 at 22:22

0

Browse other questions tagged or ask your own question.