In previous versions, the following code, taken from here from @kglr, used to give a reasonably sized legend, but in version 10.3 gives a huge legend.

lst = {10*Cos[u]*Sin[v], 3*Sin[u]*Sin[v], 2*Cos[v]};

colFun = Function[{u, v}, Hue[Rescale[dam, {0, 1}]]];

dam = Sqrt[(1296*Cos[u]^4*
       Sin[v]^4)/(900*Cos[v]^2 + 36*Cos[u]^2*Sin[v]^2 + 
        400*Sin[u]^2*Sin[v]^2)^2 + (3600*Cos[u]^2*
       Sin[v]^2*(9*Cos[v]^2 + 4*Sin[u]^2*Sin[v]^2))/(900*Cos[v]^2 + 
        4*(9*Cos[u]^2 + 100*Sin[u]^2)*Sin[v]^2)^2] // FullSimplify;

{min, max} = {-10, 10};
h2 = ParametricPlot3D[lst, {u, 0, 2*Pi}, {v, 0, Pi}, Mesh -> False, 
  ColorFunction -> (Function[{x, y, z, u, v}, 
     Hue[Rescale[dam, {0, 1}]]]), ColorFunctionScaling -> False, 
  ImageSize -> 800, 
  PlotLegends -> 
   BarLegend[{Hue, {min, max}}, ColorFunctionScaling -> True]]

Here is the result now,

enter image description here

Compare with the result from a previous version,

enter image description here

There is difference between the size of the associated BarLegends. How can I restore previous performance?

I hope now it is clearer the situation.


  • 3
    $\begingroup$ I might be going cross-eyed, but I'm not seeing any difference in the ellipsoids. $\endgroup$ – J. M.'s torpor Nov 17 '15 at 18:17
  • $\begingroup$ Hello j.m. I am replying through mobile phone. The difference is in the associated bar legends. $\endgroup$ – Dimitris Nov 17 '15 at 19:24
  • 4
    $\begingroup$ Please edit the question to state explicitly what the issue is. $\endgroup$ – Simon Woods Nov 17 '15 at 19:48
  • $\begingroup$ I have edit the question. $\endgroup$ – Dimitris Nov 18 '15 at 8:40
  • $\begingroup$ I received one more vote for closing since the editing. It is not clear now that an issue does exist? $\endgroup$ – Dimitris Nov 18 '15 at 9:03

You can add the LegendMarkerSize option to BarLegend, or simply click on the legend to make it active in the output, then drag a handle to change size.

I'd venture something was jiggered in what the default (Automatic) setting of that does between versions.

  • $\begingroup$ Thanks for the answer. Weird change of settings:-)! $\endgroup$ – Dimitris Nov 18 '15 at 9:02
  • 1
    $\begingroup$ Agreed. I find setting LegendMarkerSize -> 400 fixes it right up. It's also odd that ColorFunctionScaling is undocumented as an option for BarLegend $\endgroup$ – Jason B. Nov 18 '15 at 9:08
  • $\begingroup$ @JasonB: Thanks for the editing and the useful comment. $\endgroup$ – Dimitris Nov 18 '15 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.