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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:27:25+00:00 2026-05-20T00:27:25+00:00

I have a population and a sample of that population. I’ve made a few

  • 0

I have a population and a sample of that population. I’ve made a few plots comparing them using ggplot2 and its faceting option, but it occurred to me that having the sample in its own facet will distort the population plots (however slightly). Is there a way to facet the plots so that all records are in the population plot, and just the sampled records in the second plot?

  • 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-20T00:27:25+00:00Added an answer on May 20, 2026 at 12:27 am

    Matt,

    If I understood your question properly – you want to have a faceted plot where one panel contains all of your data, and the subsequent facets contain only a subset of that first plot?

    There’s probably a cleaner way to do this, but you can create a new data.frame object with the appropriate faceting variable that corresponds to each subset. Consider:

    library(ggplot2)
    df <- data.frame(x = rnorm(100), y = rnorm(100), sub = sample(letters[1:5], 100, TRUE))
    
    df2 <-  rbind(
        cbind(df, faceter = "Whole Sample")
        , cbind(df[df$sub == "a" ,], faceter = "Subset A")
        #other subsets go here...
    )
    
    qplot(x,y, data = df2) + facet_wrap(~ faceter)
    

    Let me know if I’ve misunderstood your question.

    -Chase

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

Sidebar

Related Questions

I have a listbox that I am populating using a foreach. (Long explanation of
I have a table that reflects a monthly census of a certain population. Each
I support a .NET IE Toolbar, for a population of users that have a
I have an html select: <select> <option>Choose one</option> </select> Using jQuery, is there an
So I have a simple setup, an autocompletebox with its Populating event that I
I have a gsp page that includes a JS function ( named sample) which
I have to solve the Travelling Salesman Problem using a genetic algorithm that I
I have a primarly code based iphone sample app that works. It is Navigation
I have data for countries which include Name, Population, Area etc for countries... What
Scenario: I have an application (C#) that expects a SQL database and login, which

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.