Message Boards Message Boards

0
|
4947 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Replacing numbers with labels in the ticks of BarLegend?

Posted 4 years ago

I want to create a BarLegend consisting of the colors

Table[Lighter[Red, 1 - i], {i, 0.3, 1, 0.15}]

and than to remove from the bar the numbers on its left.

I what I have at the moment is this:

bar = BarLegend[{Table[Lighter[Red, 1 - i], {i, 0.3, 1, 0.15}], {0, 
    1}}, LegendMarkerSize -> 350, LabelStyle -> Directive[Black, 16]]

enter image description here

And I want to add the words Low and High to the number 0 and 1, so to get something like this:

enter image description here

(This was created with an image editor)

How Can I do that?

I tried passing None instead of {0,1} in my command but that produced no graphics at all.

POSTED BY: Ehud Behar
2 Replies
Posted 4 years ago

Thanks!

POSTED BY: Ehud Behar
Posted 4 years ago

Using undocumented options

BarLegend[{Table[Lighter[Red, 1 - i], {i, 0.3, 1, 0.15}], {0, 1}},
 LegendMarkerSize -> 350,
 LabelStyle -> Directive[Black, 16],
 "Ticks" -> {0, 1},
 "TickLabels" -> {"Low", "High"}]

enter image description here

More details here.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract