Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long titles are displayed incorrectly #289

Closed
ASmirnov-HORIS opened this issue Jan 15, 2021 · 4 comments
Closed

Long titles are displayed incorrectly #289

ASmirnov-HORIS opened this issue Jan 15, 2021 · 4 comments

Comments

@ASmirnov-HORIS
Copy link
Collaborator

ASmirnov-HORIS commented Jan 15, 2021

Look at the following simple example:

from lets_plot import *
LetsPlot.setup_html()

ggplot() + geom_rect(xmin=0, xmax=1, ymin=0, ymax=1) + \
    ggtitle('A B C D E F G H I J K L M N O P Q R S T U V W X Y Z'
            'a b c d e f g h i j k l m n o p q r s t u v w x y z')

The problem here is not only that there is not enough space for a long title, but that the title is shifted from the center.

Even with not very long titles we face a similar situation. For example, when we put a few small plots into GGBunch().

Screen from my notebook:

@alshan
Copy link
Collaborator

alshan commented Jan 15, 2021

As a workaround let's align the title to the left instead of center. @OLarionova-HORIS could you take a look?

@OLarionova-HORIS
Copy link
Contributor

PR: #293

@alshan
Copy link
Collaborator

alshan commented Jan 20, 2021

@OLarionova-HORIS Aligning to the left of the overall plot area in not looking good:
image

Let's align to the left of 'geom' area inside plot. See:
http://www.cookbook-r.com/Graphs/Titles_(ggplot2)/

@OLarionova-HORIS
Copy link
Contributor

Now the title is inside the geom area of the plot.
Commit: 43c4c40
Result of these changes:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants