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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:53:20+00:00 2026-06-11T19:53:20+00:00

I need to plot the following dataset in the same graph. Bin1,Bin2,Bin3,Cat 4,3,5,S 6,4,5,M

  • 0

I need to plot the following dataset in the same graph.

Bin1,Bin2,Bin3,Cat
4,3,5,S
6,4,5,M
3,5,4,M
1,4,5,M
 ,5, ,M

In each bin, first data point belongs to a different category than the rest. (So I added the Cat column)

I need to plot these as points (different colors for the different categories)

Following lines of code achieve what I need for a single bin

p <- ggplot(data,aes(Bin1,1))
p + geom_point(aes(color=Cat, size=Cat))

How do I do this for the entire dataset ?


Here is a related question?

What if I need to use a bunch of columns to color the points. Color Bin1 points according to Cat1 and so on..

Bin1,Cat1,Bin2,Cat2
4,S,5,S
6,L,5,M
3,M,4,L
1,M,5,L
    3,M

How do I do this??

  • 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-11T19:53:21+00:00Added an answer on June 11, 2026 at 7:53 pm
    library(reshape2)
    library(ggplot2)
    ggplot(melt(df, id.vars = "Cat"), aes(value, variable, colour = Cat)) + 
    geom_point(size = 4)
    

    enter image description here

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

Sidebar

Related Questions

I'm having data as like below. I need to plot graph based on region.
I need to read some data from an input file and plot a graph
I have following data and plot: pos <- rep(1:2000, 20) xv =c(rep(1:20, each =
I need plot a curve for my data , the source is like :
I'm using Flot and would like to associate text with each individual plot point
I need create a box plot from a data.frame with three numeric columns ,
I'm using the following data and code to create a 3D plot, but the
I have produced the following surface plot in matlab: and I need to create
I need to plot some discrete predictions with probability intervals in ggplot2, but I'm
I need to plot multiple sphere and I was using the example code from

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.