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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:33:53+00:00 2026-06-09T22:33:53+00:00

I have a ggplot graph that I would like to insert custom string below

  • 0

I have a ggplot graph that I would like to insert custom string below 0 as “Within” and above 0 as “Breached”.

I am doing this:

ggplot(z, aes(Date, Breach1/60, group=Jobs, label=c("Within SLA", "Breached SLA"))) + 
 geom_line(size=1) + 
 theme_bw() + ylab("Hours") + xlab("Date") + opts(title="Jobs") + 
 geom_hline(yintercept=0, color="red", size=2) + geom_text(hjust=0, vjust=3)

This seems to put text all over the place. I like to put one text above the zero and one text below the zero value. Any ideas?

  • 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-09T22:33:55+00:00Added an answer on June 9, 2026 at 10:33 pm

    You are after annotate:

    ggplot(z, aes(Date, Breach1/60, group=Jobs)) + 
     geom_line(size=1) + 
     theme_bw() + ylab("Hours") + xlab("Date") + opts(title="Jobs") + 
     geom_hline(yintercept=0, color="red", size=2) + 
     annotate("text", label = "Within SLA", x = 1, y = 2) +
     annotate("text", label = "Breached", x = 1, y = -2) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following function, which I would like to plot using ggplot: f(x)
I have a dataframe that I would like to plot in a similar way
I have some data that is constrained below a 1:1 line. I would to
I have a facetted plot like this: ggplot(mtcars, aes(x = hp, y = mpg))
I have a dataframe that looks like this: data median min max no_of_threads 2.33
I have the following graph that I generated using ggplot2 I had finalPlot as
I have an ggplot2 point chart created like this qplot(Index, Popularity ,data = data.slopeone.agg)
I have a series of ggplot graphs that I'm repeating with a few small
I know that after I create a ggplot graph I can use theme_get() to
I have a data frame like this Date Team Score 1/1/2010 A 10 1/1/2010

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.