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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:28:01+00:00 2026-05-31T08:28:01+00:00

See this example This was created in matlab by making two scatter plots independently,

  • 0

See this exampleExample of overlaid scatter plots

This was created in matlab by making two scatter plots independently, creating images of each, then using the imagesc to draw them into the same figure and then finally setting the alpha of the top image to 0.5.

I would like to do this in R or matlab without using images, since creating an image does not preserve the axis scale information, nor can I overlay a grid (e.g. using ‘grid on’ in matlab). Ideally I wold like to do this properly in matlab, but would also be happy with a solution in R. It seems like it should be possible but I can’t for the life of me figure it out.

So generally, I would like to be able to set the alpha of an entire plotted object (i.e. of a matlab plot handle in matlab parlance…)

Thanks,

Ben.

EDIT: The data in the above example is actually 2D. The plotted points are from a computer simulation. Each point represents ‘amplitude’ (y-axis) (an emergent property specific to the simulation I’m running), plotted against ‘performance’ (x-axis).

EDIT 2: There are 1796400 points in each data set.

  • 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-31T08:28:02+00:00Added an answer on May 31, 2026 at 8:28 am

    Using ggplot2 you can add together two geom_point‘s and make them transparent using the alpha parameter. ggplot2 als adds up transparency, and I think this is what you want. This should work, although I haven’t run this.

    dat = data.frame(x = runif(1000), y = runif(1000), cat = rep(c("A","B"), each = 500))
    ggplot(aes(x = x, y = y, color = cat), data = dat) + geom_point(alpha = 0.3)
    

    ggplot2 is awesome!

    This is an example of calculating and drawing a convex hull:

    library(automap)
    library(ggplot2)
    library(plyr)
    loadMeuse()
    theme_set(theme_bw())
    
    meuse = as.data.frame(meuse)
    chull_per_soil = ddply(meuse, .(soil), 
               function(sub) sub[chull(sub$x, sub$y),c("x","y")])
    
    ggplot(aes(x = x, y = y), data = meuse) +
      geom_point(aes(size = log(zinc), color = ffreq)) +
      geom_polygon(aes(color = soil), data = chull_per_soil, fill = NA) +
      coord_equal()
    

    which leads to the following illustration:

    enter image description here

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

Sidebar

Related Questions

See this example! int main( int argc, char ** argv ) { int *ptr
For more information see this Example use strict; use warnings; use CGI::Simple; use DBI;
My current solution will suck sometimes EDIT For those who don't understand,see this example:
Looking for a proven to work algorithm for production. Did see this example but
I would like to see how this example of existing code would be able
Consider this example: zh_Hant_HK format = yy'年'M'月'd'日' ah:mm Not sure if you can see
i'm playing with MEF and in the example i see this code ( i
How do I install a leiningen plugin? For example, leiningen-run? I see this thing
I see a lot of example code for C# classes that does this: public
See, for example, §13.3.3 and §13.3.4 . It doesn't seem to me that this

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.