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$

marked as duplicate by Ajasja, whuber, rm -rf Oct 17 '12 at 19:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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 '12 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 '12 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 '12 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 '12 at 22:22