BarLegend[{{Blue, White, Red}, {0, 4}},
Ticks -> {{0, "0"}, {2, "1e-2"}, {4, "2e-2"}},
LegendLayout -> "Column", Charting`TickSide -> Right]
How can I add different ticks on the left side to get something like this
We can process the box expressions to add the desired ticks on the left frame:
ClearAll[addLeftFrameTicks]
addLeftFrameTicks[ticks_] := RawBoxes @ Replace[ToBoxes @ #,
GraphicsBox[{___, _RasterBox, ___}, ___] -> ToBoxes @
Show[First @ Cases[ToBoxes @ #,
g : GraphicsBox[{___, _RasterBox, ___}, ___] :> ToExpression[g], All] & /@
{#, # /. r__Rule :> {Ticks -> ticks, Charting`TickSide -> Left, r}}], All] &;
Examples:
leftticks = {{1, "one"}, {2, "two"}, {3, "three"}};
addLeftFrameTicks[leftticks] @
BarLegend[{{Blue, White, Red}, {0, 4}},
LegendLabel -> Style["legend", 20],
Ticks -> {{0, "0"}, {2, "1e-2"}, {4, "2e-2"}},
LabelStyle -> 14,
LegendFunction -> Panel]
Add the options LegendLayout -> "Row"
and LegendMarkerSize -> {400, 100}
to BarLegend[...]
to get