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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:38:43+00:00 2026-05-20T05:38:43+00:00

Is there a way to include a panel for unused levels of a factor

  • 0

Is there a way to include a panel for unused levels of a factor used in faceting?

The reason I want to do this is because I’m arranging several separate plots in rows showing different measures, with each row having the same number of facet_grid panels in columns. Each plot should line up by column.

But when the data for one of the rows is missing data for a particular facet level, the number of panels will be different and the columns do not line up. For example, notice the last row is missing the “Mathematics II” panel:

Example plot http://dl.dropbox.com/u/14792859/ggplot2%20facet%20levels.png

The only work-around I can think of is to include a dummy data-point for any missing facet levels, but I would love to hear that there is an easier/cleaner way.

  • 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-20T05:38:44+00:00Added an answer on May 20, 2026 at 5:38 am

    As Ben Bolker mentioned, this appears to be a bug in ggplot2 caused by a bug in plyr. This is slated to be fixed in the upcoming plyr 1.5 release.

    • ggplot2 mailing list thread
    • plyr fix

    In the meanwhile, I worked around the issue by creating a single plot and using facet_grid, with rows specifying the different measures to be plotted. The problem with this is that I can’t specify a different scale_fill_manual for the two bottom panels, so I used stroke color for the middle panel instead — not ideal but good enough for now.

    Thanks Ben for figuring this out and starting the mailing list conversation.

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

Sidebar

Related Questions

Is there way to set @include mixin(); to variable? I tried this @mixin bg-gradient($fallback,
I want to know if there is a way to use something like this:
Is there any way to include php file using require and calling a php
Is there a way to include a LIKE expression in a GROUP BY query?
Is there a way to include some aspx/ascx markup in a DLL and use
Is there a way to not be forced to include members with the MustOverride
Is there any way to configure Doxygen to include the log from SVN for
Is there a way for me to include a simple array of strings, or
(Is there a way to | How do I) include a custom description for
Is there a way to format the output of Select-String to include newlines between

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.