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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:02:41+00:00 2026-06-07T00:02:41+00:00

I am plotting boxplots from this data: MY_LABEL MY_REAL MY_CATEGORY 1 [POS] .56 POS

  • 0

I am plotting boxplots from this data:

MY_LABEL     MY_REAL     MY_CATEGORY
1 [POS]       .56            POS
1 [POS]       .57            POS
1 [POS]       .37            POS
2 [POS]       .51            POS
1 [sim v]     .65            sim v
...

I’m using ggplot2:

ggplot( data=myDF, aes( x=MY_LABEL, y=MY_REAL, fill=MY_CATEGORY ) ) +
    scale_colour_manual( values=palette ) +
    coord_flip() + 
    geom_boxplot( outlier.size = 0 )

This works fine, and groups the boxplots by the field MY_CATEGORY:
enter image description here

I’d like to do 2 things:

1) To improve the clarity of this plot, I’d like to add separators between the various blocks, i.e. between POS and sim v, between sim v and C, etc (see the ugly red lines in the plot).
I’ve been struggling with geom_vline with no luck.
Alternatively, I’d like to add blank space between the blocks.

2) If I print this plot in grayscale, I can’t distinguish the different blocks. I’m trying to force a different palette with:

scale_colour_manual( values=c("black","darkgray","gray","white") )

Again, no luck, the plot doesn’t change at all.

What would you suggest to do?

  • 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-07T00:02:42+00:00Added an answer on June 7, 2026 at 12:02 am

    Would this work for you?

    require(ggplot2)
    mtcars$cyl2<- ifelse(mtcars$cyl > 4, c('A'), c('B')) 
    p <- ggplot(mtcars, aes(factor(cyl), mpg))
    p + geom_boxplot() + facet_grid(. ~ cyl2, scales = "free", space = "free")
    

    would give something like this,
    bbb

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

Sidebar

Related Questions

I am plotting a dataset using the following: plot = ggplot(transData, aes(x=Time, y=Value)) +
I am plotting a number of data sets using ggplot2 in R. To make
I'm plotting a group of curves, using facet in ggplot2. I'd like to have
I am plotting a financial candlestick chart using this MATLAB function: http://www.mathworks.com/help/toolbox/finance/candlefts.html How do
I'm using rpy2 to do data analysis and plotting in python. It works fine
When plotting multiple data series using both line specification ( X , Y ,
when plotting my data using gnuplot, I experience that the right border is cut
I want to write a bash script to automate the plotting of data, using
I'm plotting data which extent, in x, from -1000 to 1000. But I'm only
Is there an equivalent method for plotting functions using ggplot to the curve() command

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.