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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:55:21+00:00 2026-05-30T05:55:21+00:00

I am getting a small problem using ggplot2 geom_line graph. When I apply ylim

  • 0

I am getting a small problem using ggplot2 geom_line graph.

When I apply ylim, the graph goes empty. In a default mode, the ggplot clutters up the y-axis with all the values, but I want to increase the reference limits to little big gaps, i.e from 17.3,17.5,17.7 to 17-18 with the graph intact. I am using ylim(c(15,30)), the limit is increased but graph disappears.

I tried using scale_y_continuous(breaks=c(15,30)):

[Error: Non-continuous variable supplied to scale_y_continuous]

and scale_y_discrete(breaks=c(15,30))

[Whole y bar disappears]

enter image description here

After limits:
enter image description here

DataFrame:

>head(meltedB)
             Mouse     Type       days weight
    1      21-H807  control 2011-09-23   27,0
    2      21-H808  control 2011-09-23   27,8
    3 21-H809/J125 knockout 2011-09-23   29,1
    4      21-H810  control 2011-09-23   27,2
    5      21-H811  control 2011-09-23   18,2
    6      21-H812  control 2011-09-23   18,8

Command used :

ggplot(na.omit(meltedB),aes(factor(days),weight,group=Mouse)) + 
    geom_line(aes(color=Mouse),size=2) + 
    facet_grid(Type~.)

** For someone who is struggling with plotting of NA values, use na.omit on your dataframe, they wont be plotted.

  • 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-30T05:55:23+00:00Added an answer on May 30, 2026 at 5:55 am

    There are two big hints that R has provided you to diagnose this problem. The first is the really ugly decision about the y axis tick labeling. The second is the explicit error message that says you passed a “non-continuous” variable to scale_y_continuous.

    Your y variable is stored as a factor (or possibly a character). Type str(meltedB) at the console to confirm.

    The problem is most likely the commas. You’ll need to go back to when you read in the data and change the dec argument to read.table, which is set to a period by default.

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

Sidebar

Related Questions

I'm getting crazy with a small problem here, I keep getting an error and
Hi all I've a small problem to map one-to-one using JPA 2 persistence with
I am having small problem in making a global variable works. I am using
I'm running into a small problem at the end of the Getting Started guide
I'm currently using JScript.NET for a small UI application. The problem is that my
I am getting ready to write lot of small experimental java programs as I
I've getting quite fast with a small django project of mine, which I'm developing
I'm getting a System.NullReferenceException when my application starts up (after a small login screen)
Just tried some small graphics application of mine on Windows 7, and I'm getting
Getting started with NHibernate How can I generate identity fields in nHibernate using Hilo

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.