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

  • Home
  • SEARCH
  • 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 6795669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:22:28+00:00 2026-05-26T18:22:28+00:00

I am making a dotplot using ggplot with the code and data that is

  • 0

I am making a dotplot using ggplot with the code and data that is below which produces the following the graph.

ggplot(data=holder, aes(x=Coef, y=CoefShort, colour=factor(Name))) + geom_point() + labs(x="Value", y="Coefficient") + scale_colour_discrete("Model")

dotplot

Their is a significant amount of overplotting and I would like to create some vertical seperation between dots. But it has to be systematic, i.e. the order is always red-green-blue.

geom_stack only seems to work when the x value is the same, not when the y value is the same. I tried using the opposite axes (swapping the x and y), doing a position_dodge() then doing a coord_flip(). This only works with bars, as seen below.

ggplot(data=holder, aes(y=Coef, x=CoefShort, fill=factor(Name))) + geom_bar(position="dodge", aes(ymax=Coef)) + labs(y="Value", x="Coefficient") + scale_fill_discrete("Model") + coord_flip()

Vertically dodged bar chart

Any ideas how to achieve that stacking with geom_point()? Thanks.

The data:

structure(list(Coef = c(-3875.46969970703, 7871.08213392282,
1120.33185255098, 1510.13540851347, 1439.07714113149, 1800.92398445336,
-3760.05411752962, 8183.74295221482, 1126.98290537184, 1517.99524139857,
1442.73063836897, 1808.03721179571, -90.6507661872817, -71.7225864185226,
-103.615416254984, -732.167583256825, -1075.67574987664, -1908.56266462926,
-7362.80215630299, 8886.12888250011, 655.767448263926, 848.716877683527,
869.395903077767, 998.254438325812, -211.682481369473, -303.310032581644,
-506.1995360406, -978.697664841985, -1440.30190190734, -2325.22236024601,
2625.94998656519, 3573.68798735398, 4217.82910198788, 4534.8789695778,
4967.19941000705, 5072.02764498623, 5419.64684461491), Name = c(1,
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3), CoefShort = structure(c(1L,
2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L,
11L, 12L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L,
13L, 14L, 15L, 16L, 17L, 18L, 19L), .Label = c("(Intercept)",
"carat", "Good", "Very Good", "Premium", "Ideal", "E", "F", "G",
"H", "I", "J", "SI2", "SI1", "VS2", "VS1", "VVS2", "VVS1", "IF"
), class = "factor")), .Names = c("Coef", "Name", "CoefShort"
), class = "data.frame", row.names = c(NA, -37L))

  • 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-05-26T18:22:29+00:00Added an answer on May 26, 2026 at 6:22 pm

    points in geom_point is zero width, so you need to set the width of dodging:

    ggplot(data=holder, aes(y=Coef, x=CoefShort, colour=factor(Name))) + 
      geom_point(position=position_dodge(width = 0.8)) + 
      labs(y="Value", x="Coefficient", colour = "Model") + 
      coord_flip()
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Making an adobe flex ui in which data that is calculated must use proprietary
Making UML sequence diagram in VS 2010RC I've observed that there is no activation
When making changes using SubmitChanges() , LINQ sometimes dies with a ChangeConflictException exception with
Making a flash page that can cycle through these three images on mouseclick. For
Making an Flex App. Just wondering if anyone has created something that fits automatically
i making a application where i need total amount of data used by user
im making an application that store multipe information like name description images for each
Im making an app for the iphone using cocos2d and i am trying to
Making sense out of an .MSI verbose trace. I created the .MSI using VisualStudio
making an Access database (2003) that is mainly used by other programmers and tech

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.