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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:42:01+00:00 2026-05-20T18:42:01+00:00

I am attempting to add a shape aesthetic mapping to an existing plot but

  • 0

I am attempting to add a shape aesthetic mapping to an existing plot but am receiving the error below. Is there a different way to accomplish this? If I remove shape=Port from the function call, everything works as expected.

p <- ggplot(data=w, aes(OAD,RtgValInt,color=dt,shape=Port)) +
    geom_jitter(size=3, alpha=0.75) +
     scale_colour_gradient(limits=c(min(w$dt), 
             max(w$dt)),
         low="#9999FF", high="#000066") +
     geom_point(data=data.frame(OAD=w$OAD[1], 
             RtgValInt=w$RtgValInt[1]), 
         color="red", size=3)
print(p)

Error in eval(expr, envir, enclos) : object 'Port' not found

The data frame w includes the data below.

Date          Port    OAD         RtgValInt   dt
12/31/2010  Grp1    1.463771    1.833333    14974
12/31/2010  Grp2    1.193307    2.071429    14974
11/30/2010  Grp1    1.454115    1.833333    14943
11/30/2010  Grp2    1.127755    2.071429    14943
10/29/2010  Grp1    1.434965    2.000000    14911
10/29/2010  Grp2    1.055758    2.071429    14911
09/30/2010  Grp1    1.441773    2.000000    14882
09/30/2010  Grp2    1.077799    2.071429    14882
  • 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-20T18:42:02+00:00Added an answer on May 20, 2026 at 6:42 pm

    Since every layer inherits the default aes mapping, you need to nullify the shape aes in geom_point when you use different dataset:

    p <- ggplot(data=w, aes(OAD,RtgValInt,color=dt,shape=Port)) +
      geom_jitter(size=3, alpha=0.75) +
      scale_colour_gradient(limits=c(min(w$dt), 
          max(w$dt)),
        low="#9999FF", high="#000066") +
      geom_point(aes(shape=NULL), data=data.frame(OAD=w$OAD[1], 
          RtgValInt=w$RtgValInt[1]), 
        color="red", size=3)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting add some tests to an existing QT GUI application using QTest.
The site has an existing rotating header banner and I am attempting to add
I'm attempting to add a UIImageView to the subview of a UILabel, but for
I'm attempting to add some text to the directions results the Google Maps API
I'm attempting to use extension methods to add an operater overload to the C#
Attempting to print out a list of values from 2 different variables that are
When attempting to compile my C# project, I get the following error: 'C:\Documents and
I am attempting add a tableadapter to a stored procedure in my SQL Server
Im attempting to add voteup/votedown to one of my sites, however Im having a
I am attempting to add smart exception handling to a Silverlight 4 RIA application

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.