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

  • Home
  • SEARCH
  • 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 518003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:53:33+00:00 2026-05-13T07:53:33+00:00

I have the following setup: emp <- structure(list(s = structure(c(1L, 2L, 2L, 2L, 7L,

  • 0

I have the following setup:

emp <- structure(list(s = structure(c(1L, 2L, 2L, 2L, 7L, 7L, 3L, 4L, 4L, 4L, 4L, 8L, 8L, 8L, 9L, 9L, 9L, 9L, 10L, 5L, 5L, 6L), .Label = c("8", "24", "31", "78", "135", "142", "30", "98", "117", "123"), class = "factor", scores = structure(c(1, 2, 14, 3, 5, 17, 18, 20, 11, 13), .Dim = 10L, .Dimnames = list(c("8", "24", "30", "31", "78", "98", "117", "123", "135", "142")))), t = structure(c(6L, 1L, 2L, 4L, 7L, 9L, 3L, 1L,  2L, 4L, 5L, 8L, 9L, 10L, 7L, 8L, 9L, 11L, 9L, 1L, 4L, 1L), .Label = c("8", "24", "40", "78", "135", "142", "30", "98", "117", "119", "123" ), class = "factor", scores = structure(c(1, 2, 14, 4, 5, 17, 18, 19, 20, 11, 13), .Dim = 11L, .Dimnames = list(c("8", "24", "30", "40", "78", "98", "117", "119", "123", "135", "142")))), V1 = c(3L, 1L, 9L, 4L, 1L, 107L, 2L, 5L, 3L, 1L, 2L, 1L,  6L, 14L, 20L, 1L, 4L, 1L, 2L, 3L, 2L, 2L)), .Names = c("s", "t", "V1"), row.names = c(NA, -22L), class = "data.frame")
o <- c(8L, 24L, 31L, 40L, 78L, 80L, 85L, 94L, 104L, 113L, 135L, 136L, 142L, 30L, 54L, 91L, 98L, 117L, 119L, 123L, 9L, 34L, 97L, 126L,  140L, 13L, 75L, 92L, 134L, 138L, 141L, 6L, 12L, 22L, 44L, 48L, 51L, 57L, 64L, 79L, 84L, 88L, 93L, 100L, 115L, 124L, 129L, 132L,  143L, 144L, 2L, 10L, 14L, 15L, 16L, 17L, 19L, 35L, 39L, 41L, 50L, 52L, 53L, 58L, 61L, 66L, 67L, 68L, 71L, 72L, 73L, 76L, 96L, 99L, 101L, 106L, 109L, 114L, 121L, 127L, 128L, 131L, 137L, 145L, 146L, 148L, 150L, 4L, 18L, 23L, 28L, 29L, 32L, 37L, 38L, 65L, 82L, 90L, 102L, 105L, 107L, 111L, 122L, 130L, 133L, 139L, 147L, 3L, 5L, 7L, 11L, 21L, 27L, 33L, 43L, 45L, 46L, 47L, 49L, 55L, 56L, 59L, 60L, 62L, 63L, 69L, 70L, 77L, 83L, 87L, 89L, 103L, 108L, 112L, 116L, 118L, 120L, 125L, 149L, 151L, 1L, 20L, 25L, 26L, 36L, 42L, 74L, 81L, 86L, 95L, 110L)

emp$s <- reorder(factor(emp$s),match(emp$s,o))
emp$t <- reorder(factor(emp$t),match(emp$t,o))
qq <- ggplot(emp,aes(x=s,y=t))
qq + geom_tile(aes(fill=log(V1)))+theme_bw()+
scale_fill_gradient(low="white",high="black")+
opts(axis.text.x=theme_text(angle=-90, hjust=0, size=5),
     axis.text.y=theme_text(vjust=0, size=5),
     panel.grid.minor = theme_blank(),
     panel.grid.major = theme_blank())

This produces the following:

alt text

I would like to include a vertical line just after 142 and before 30. (Note, I need to keep these values as a factor.) I’ve been considering two options:

  • vline: I only am able to put the line on 142 and on 30, but not between them.
  • grid stuff: I feel like the ideal solution is to introduce a grid.major or something.

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-05-13T07:53:33+00:00Added an answer on May 13, 2026 at 7:53 am

    I’m not sure if this is what you mean:

    p <- ggplot(emp, aes(x=s, y=t)) +
         geom_tile(aes(fill=log(V1))) +
         theme_bw() +
         scale_fill_gradient(low="white", high="black") +
         theme(axis.text.x=element_text(angle=-90, hjust=0, size=5),
               axis.text.y=element_text(vjust=0, size=5),
               panel.grid.minor=element_blank(),
               panel.grid.major=element_blank()) +
         geom_vline(xintercept=which(levels(emp$s) %in% c("142", "30")) + c(0.25, -0.25))
    print(p)
    

    ggplot2 output

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

Sidebar

Ask A Question

Stats

  • Questions 303k
  • Answers 303k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer >>> '%11.4f' % -3.5 ' -3.5000' or the new style… May 13, 2026 at 8:37 pm
  • Editorial Team
    Editorial Team added an answer See jQueryUI. Specifically draggable and droppable. May 13, 2026 at 8:37 pm
  • Editorial Team
    Editorial Team added an answer I think learning a new language will make you a… May 13, 2026 at 8:37 pm

Related Questions

I have the following setup: Code on my local machine (OS X) shared as
I have the following setup: <VirtualHost *:80> ServerName svn.project1.com <Location /> DAV svn SVNPath
I have the following setup for my Blog Data Model: Blog Articles Categories -----
I have the following setup: ASP.net 3.5 Web Site Project C# Class Library with
I have the following setup, and I need to know how to persist state.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.