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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:35:16+00:00 2026-05-27T22:35:16+00:00

I am trying to make a bar plot that has extra data on it.

  • 0

I am trying to make a bar plot that has extra data on it. Associated with each data point is a value from a factor that indicates why the height is what it is. So far I’m reasonably happy with my results:

library(ggplot2)

tab <- read.table("http://www.cs.colorado.edu/~coxaj/table2.csv",
            header=T, sep=",", strip.white=T)
tab <- with(tab, tab[order(Analysis, -as.numeric(Analysis)), ])

bar_width <- 0.5
space_width <- 0.8

p <- ggplot(tab, aes(x=Filter,y=Depth,fill=Analysis)) +
  geom_bar(position=position_dodge(width=space_width), width=bar_width) +
  geom_point(position=position_dodge(width=space_width), aes(shape=Termination)) +
  scale_shape_manual(values=c(1,4,5,6)) +
  geom_hline(aes(yintercept=16, linetype=2)) +
  scale_x_discrete(name='') +
  scale_y_continuous(name='Search Depth') +
  scale_fill_manual(values=c("#E66101", "#FDB863", "#B2ABD2", "#5E3C99")) +
  theme_bw()

ggsave(filename='table2.pdf', height=3, width=8)

This produces a plot that looks like this:
example output

The problem is that it puts these pointless circles in the legend for Analysis. I would like to remove that circle, but keep the legend. Does ggplot2 let me do this?

  • 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-27T22:35:17+00:00Added an answer on May 27, 2026 at 10:35 pm

    try this:

    p <- ggplot(tab, aes(x=Filter,y=Depth)) +
      geom_bar(aes(fill = Analysis), 
               position=position_dodge(width=space_width), width=bar_width) +
      geom_point(position=position_dodge(width=space_width), 
                 mapping = aes(group = Analysis, shape=Termination)) +
    ...
    

    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 make a horizontal bar chart with data from an array $values
I'm trying to make a progress bar that updates the user on the progress
Trying to make a custom :confirm message for a rails form that returns data
I am trying to make a sort of progress bar that gets filled, with
I'm trying to make a class Bar that extends a class Foo . The
Im trying to make a side bar for my blog archive that lists out
I'm trying to make a progress bar that starts at 0%, and takes 5
I'm new to python and I'm trying to make a search bar that searches
Trying to make a make generic select control that I can dynamically add elements
Trying to make a generic PL/SQL procedure to export data in specific XML format,

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.