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 9126433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:02:32+00:00 2026-06-17T07:02:32+00:00

I am trying to plot several features of a group of samples to various

  • 0

I am trying to plot several features of a group of samples to various aesthetics. Border color and size of a circle is one of them. However, if I try to set a larger baseline border for these shapes, by setting lwd=2, the shapes all revert to the same size and the legend is gone. I just want the circles to have a larger border, how can I do this?

An example:

library(ggplot2)
testFrame <- data.frame(
  sizeVar=factor(c('a', 'a', 'a', 'a', 'b', 'b', 'b', 'b')),
  samples=rep(c('Sample1', 'Sample2'), times=4),
  features=c(rep('Feature1', times=4), rep('Feature2', times=4))
)
testPlot <- ggplot(data=testFrame, aes(x=samples, y=features))
testPlot + 
    geom_point(aes(size=sizeVar), pch=21, color='black', fill='gray') +
    scale_size_manual(values=c(9,4)) + theme_bw()
testPlot + 
   geom_point(aes(size=sizeVar), pch=21, lwd=3, color='black', fill='gray') + 
   scale_size_manual(values=c(9,4)) + theme_bw()

Output without lwd
enter image description here

  • 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-17T07:02:34+00:00Added an answer on June 17, 2026 at 7:02 am

    Start with your graph:

    > testPlot + 
        geom_point(aes(size=sizeVar), pch=21, color='black', fill='gray') +
        scale_size_manual(values=c(9,4)) + theme_bw()
    

    List the elements:

    > grid.ls()
    
    GRID.gTableParent.162
      background.1-6-6-1
      spacer.4-3-4-3
      panel.3-4-3-4
        grill.gTree.126
          panel.background.rect.121
          panel.grid.major.y.polyline.123
          panel.grid.major.x.polyline.125
        geom_point.points.116
        panel.border.rect.118
      axis-l.3-3-3-3
        axis.line.y.zeroGrob.136
        axis
      axis-b.4-4-4-4
        axis.line.x.zeroGrob.130
        axis
      xlab.5-4-5-4
      ylab.3-2-3-2
      guide-box.3-5-3-5
      title.2-4-2-4
    

    Now to change the appropriate element:

    > grid.edit("geom_point.points", grep=TRUE, gp=gpar(lwd=3))
    

    enter image description here

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

Sidebar

Related Questions

I'm trying to create a plot where color represents the combination of several values.
I am trying to plot using piecewise in one of my problems and I
I'm trying to plot several kernel density estimations on the same graph, and I
I am trying to plot a graph with data from several worksheets into the
I'm trying to combine several box plots across categories of different size. Here is
I am trying to plot Voltage, Current and Power of a circuit in one
I'm trying to draw a plot with several curves in it. The x-axis are
i am trying to plot values using matplotlib and i have several different classes
I am trying plot data sets consisting of 3 coordinates: X-coordinate, x-coordinate and the
Im trying to plot the roots of a polynomial, and i just cant get

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.