In this post is given the following code:
ContourPlot[Sin[x] Cos[y], {x, 0, 2 Pi}, {y, 0, 2 Pi},
Contours -> {Automatic, 10}, ColorFunction -> "Rainbow",
PlotLegends -> BarLegend[Automatic, None,
"Ticks" -> {{-1, "cold"}, {0, "ok"}, {1, "hot"}}]]
As you can see, BarLegend has 5 parameters. However, on the documentation we see that BarLegends can only take one or two parameters:
BarLegend[cf]
BarLegend[{cf,{min,max}}]
BarLegend[cf,contours]
What am I understanding wrong with the documentation ?
BarLegend
shown has two parameters and one option. The form matches the third example. The colorfunction (cf) isAutomatic
(the default), the contours on the legend are suppressed (None
) , and the option is specifying the custom ticks. $\endgroup$Patterns
$\endgroup$