Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8518789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:04:53+00:00 2026-06-11T06:04:53+00:00

I am using ggplot2 to chart bunch of items in one chart. Sincere there

  • 0

I am using ggplot2 to chart bunch of items in one chart. Sincere there could be 1 to 60 or greater items, Iam using

ggplot(df, aes(Date, Value, colour=item, group=item)) + geom_point(size=0.4)    + guides(col = guide_legend(nrow = 30, byrow=TRUE))

to make sure I have 30 rows. If it is greater than 30 items, next legend item shows ups on the second column and so forth.

But If I have fewer items like 2 or 3, legends are overthrown from the chart window.

Is there an option to force the legend to justify vertically with ggplot?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:04:54+00:00Added an answer on June 11, 2026 at 6:04 am
    + opts(legend.justification=c(0,0.8)) 
    

    did it for me. Since version 0.9.2, opts has been replaced by theme:

    + theme(legend.justification = c(0,0.8))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to produce some example graphics using ggplot2, and one of the
I am using ggplot to chart some data and I noticed that legends text
I have R code (using ggplot2) that pumps out a bunch of charts to
I'm using ggplot2 to produce many diagrams structured like this: Is there an easy
I am using ggplot to generate a chart that summarises a race made up
I am using ggplot2 to plot simple line charts of time series data. One
I'm plotting a large polar graph/pie chart of 40+ bars/rings with ggplot2 (using geom_bar
I am working on finishing up a graph generated using ggplot2 like so... ggplot(timeSeries,
I'm using ggplot2 to make some bullseye charts in R. They look delightful, and
I am using ggplot2 to plot a figure that contains nine facets. Each facet

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.