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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:54:00+00:00 2026-06-05T02:54:00+00:00

I just started trying to visualize my data by using the ggplot2 package in

  • 0

I just started trying to visualize my data by using the ggplot2 package in R and finally got to a point, where almost everything looks fine. Meaning, the axis are labeled correctly, having the right tick-marks etc.

The problem now is that although I receive no error messages when running the code below, the actual graph inside the plot is not showing up. That makes it kind of hard for me to figure out, what went wrong. Any suggestions on why this is (not) happening would be appreciated very much.

time <- seq(as.Date("2010-04-01"), as.Date("2012-02-01"), by = "2 months")

The vector of dates, used as tick-marks. A mark every 2nd month beginning with the earliest date in the data until a bit after the last date.

qplot(date, sums/1000, data=sums[(sums$lake=="Gollinsee") & (sums$maize=="no maize"),] ,color=location, group=location, main="Gollinsee without maize") +
    geom_line(size=0.7) + geom_point(size=3) +
    labs(x="Date", y=expression("Total C  [" * g %.% m^-3 * "]")) + 
    scale_x_date(breaks=(time), limits=c(min(time), max(time)), labels=format.Date(time, "%b %Y"))

Everything runs as expected until I add the last line. Without it the x-axis is too cluttered and the dates are in an undesirable format. Well with it, the following image is generated (unfortunately I am not allowed to post images yet, the links should work though):

https://i.stack.imgur.com/I6rRY.png

The not very presentable way the plot looks like without the modified x-axis.

https://i.stack.imgur.com/WidpZ.png

Kind regards!

EDIT:
The output of dput(sums)

structure(list(date = structure(c(1L, 1L, 2L, 2L, 3L, 3L, 4L, 
5L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 11L, 11L, 19L, 10L, 10L, 
12L, 12L, 14L, 14L, 16L, 16L, 19L, 15L, 20L, 20L, 13L, 13L, 17L, 
17L, 18L, 20L, 20L, 22L, 22L, 18L, 4L, 21L, 25L, 28L, 25L, 25L, 
23L, 23L, 23L, 23L, 28L, 24L, 24L, 24L, 24L, 22L, 22L, 22L, 22L, 
21L, 25L, 35L, 35L, 37L, 37L, 35L, 35L, 37L, 37L, 39L, 39L, 39L, 
39L, 36L, 28L, 33L, 33L, 33L, 33L, 31L, 31L, 31L, 31L, 29L, 29L, 
29L, 26L, 26L, 26L, 26L, 27L, 27L, 27L, 27L, 30L, 30L, 30L, 30L, 
32L, 32L, 32L, 32L, 34L, 34L, 34L, 34L, 38L, 38L, 38L, 38L, 36L, 
36L), .Label = c("2010-04-06", "2010-04-08", "2010-05-04", "2010-05-06", 
"2010-05-19", "2010-06-01", "2010-06-03", "2010-06-29", "2010-06-30", 
"2010-07-27", "2010-07-29", "2010-08-24", "2010-08-26", "2010-09-21", 
"2010-09-23", "2010-10-19", "2010-10-21", "2010-11-16", "2010-11-18", 
"2011-01-05", "2011-02-24", "2011-03-22", "2011-04-05", "2011-04-07", 
"2011-05-03", "2011-05-05", "2011-05-31", "2011-06-01", "2011-06-28", 
"2011-07-01", "2011-07-26", "2011-07-28", "2011-08-23", "2011-08-25", 
"2011-09-20", "2011-09-22", "2011-10-17", "2011-10-20", "2012-01-10"
), class = "factor"), lake = structure(c(1L, 1L, 2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L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 
2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 
1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 
2L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 
2L, 1L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 
2L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L
), .Label = c("maize", "no maize"), class = "factor"), sums = c(388.7, 
254.5, 320.4, 373.3, 224.1, 182.4, 245.5, 258.7, 47.7, 60.5, 
58.3, 103.7, 311.9, 207.7, 283.9, 308.3, 237.9, 165.4, 556.4, 
1090.4, 1792.6, 1350.5, 932.4, 526.5, 1157.8, 2343.7, 4570.9, 
393.2, 315.5, 351, 1008, 504.8, 289.9, 113.4, 117.7, 707.9, 193.4, 
122.2, 828.2, 1106.4, 837.8, 148, 777.6, 1824.6, 388, 1658.6, 
636.3, 1434.7, 770.8, 1776.4, 705.9, 1634.5, 1237.1, 1882.5, 
1073.8, 2283, 1030.7, 273, 194.6, 788.6, 1034.9, 420.7, 404.6, 
295.9, 332, 229.3, 381, 304.2, 780.2, 227.3, 50.6, 509.3, 209.7, 
675.8, 691.9, 651.7, 635.1, 560.8, 602.2, 1243.1, 733.8, 669.1, 
574.5, 379.6, 1405.3, 513.6, 612.4, 1396.4, 256.7, 486.8, 521.3, 
55.5, 48.2, 181.7, 281.3, 322.7, 478.1, 208.4, 173.8, 599.2, 
262.9, 760.7, 365.5, 746.6, 790.3, 581.7, 388.9, 826.4, 132.6, 
167.5, 817.6, 425.1, 582.2)), .Names = c("date", "lake", "location", 
"maize", "sums"), class = "data.frame", row.names = c(NA, -113L))

Kind regards!

  • 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-05T02:54:02+00:00Added an answer on June 5, 2026 at 2:54 am

    The problem is that “date” in sums is currently a factor. Convert it to a Date type. You might not have to muck around with defining “times” since I think you’re only doing that so the axis doesn’t look so cluttered. Having date as an actual date type should clean up the labels a little bit.

    sums$date <- as.Date(sums$date)
    
    qplot(date, 
          sums/1000,
          data=sums[(sums$lake=="Gollinsee") & (sums$maize=="no maize"),],
          color=location, 
          group=location, 
          main="Gollinsee without maize") +
    geom_line(size=0.7) + 
    geom_point(size=3) +
    labs(x="Date", y=expression("Total C  [" * g %.% m^-3 * "]"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just started using maven for trying to build a multi module project. Everything
I just started working using Google Maps API yesterday, and trying to set up
I just started to using the Kohana framework and I'm trying to execute a
We've just started using Backbone and I'm trying to get a handle on a
I just started trying out Amazon S3 for hosting my website's images. I'm using
Just started using log4net and trying to get my head around the config and
I just started using SASS and I am trying to figure out how to
I just started using GIT yesterday and i was trying to do something but
I just started using Matplotlib and am trying to change the color of the
I have just started using Sharepoint Foundation 2010 and I'm trying to write a

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.