Wolfram Language

Visualization: Labels, Scales, Exclusions

Use Anything as a Label

Use Hue in a LabelingFunction to represent a third quantity in 2D plots.

show complete Wolfram Language input
In[1]:=
Click for copyable input
hotjupiters = DeleteMissing[ EntityValue[ EntityClass["Exoplanet", "HotJupiter"], {"Radius", "Density", "Gravity"}], 1, Infinity]; {radius, density, gravity} = Transpose[hotjupiters]; gMinMax = MinMax[gravity]; data = Transpose[{radius, density}];
In[2]:=
Click for copyable input
labeler[data_, index_, meta_] := Placed[Hue[ Rescale[Log[QuantityMagnitude[Extract[gravity, index]]], Log[QuantityMagnitude[gMinMax]], {0, 0.5}]], Center]; ListPlot[data, PlotRange -> {{20000, 100000}, {0, 6.7}}, LabelingFunction -> labeler, ImageSize -> 400, AxesLabel -> {"Radius", "Density"}]
Out[2]=

Related Examples

de es fr ja ko pt-br ru zh