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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:57:50+00:00 2026-06-10T20:57:50+00:00

I have a dataframe like the one below: obj date colour measurement A 01

  • 0

I have a dataframe like the one below:

obj date    colour  measurement
A   01      red     10
A   02      green   20
A   03      red     5
B   01      green   10
B   02      red     30
B   03      red     50

I know how to present df[,c(“obj”,”date”,”colour”)] in a heatmap format:

chart <- ggplot(data=temp.df,aes(x=date,y=obj,fill=colour))
chart <- chart + geom_tile()

But I want to “squeeze” the “measurement” variable into the plot also, by opacity. That is for A-03, it will be the lightest red, and for B-03, it will be the darkest red.

Is it doable in R and ggplot2? Thanks.

  • 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-10T20:57:52+00:00Added an answer on June 10, 2026 at 8:57 pm

    alpha is what you are looking for. Still working on getting a reasonable legend.

     ggplot(df, aes(x=obj,y=date,fill = colour, alpha = measurement)) + 
         geom_tile() + 
         scale_fill_identity() + scale_alpha(guide = 'none')+
         theme_bw() + opts(panel.grid.major = theme_blank()) 
    

    enter image description here

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

Sidebar

Related Questions

Suppose I have a dataframe like this one: df <- data.frame (id = c(a,
I have a dataframe with numeric entries like this one test <- data.frame(x =
I have a dataframe with one column that I would like to split into
I'd like to melt the dataframe so that in one column I have dates
I have a input dataframe like this (the real one is very large, so
I have a data frame like this one below and I really want to
I have a pandas dataframe object that looks like this: one two three four
I'm have a dataframe as like below. I need to graph based on region,
I have a dataframe similar to the one generated below. Some individuals have more
I have created a script like the one below to do something I called

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.