Skip to content

How to fit long legend string in visible area under plot (line breaks)? #167

Answered by alshan
oddfrost asked this question in Q&A
Discussion options

You must be logged in to vote

When using ggsave to save plot as html bottom lines are out of page

This is bug in HTML export - I've created an issue : JetBrains/lets-plot#725

There are no line breaks for long legend string. guideLegend(nrow) creates new line for each entity but inside this entity there are no line breaks.

Technically not a bug (i.e. , expected).
Try to customize labels via limits, labels parameters in scaleColorDiscrete(), by inserting \n char as required.

However, a kind of automatic labels text wrap might be a useful improvement.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@oddfrost
Comment options

@alshan
Comment options

@alshan
Comment options

@alshan
Comment options

Answer selected by oddfrost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants