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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:17:36+00:00 2026-06-17T23:17:36+00:00

I have a scatter graph i have created in matplotlib I also have a

  • 0

I have a scatter graph i have created in matplotlib
I also have a list of tuples like so, [(1,’A’ 2),(2,’B’,0),(0,’D’,3)]
that i need to relate to a certain plot on my graph.
say when you click the point it somes up with the certain points, or have them at the bottom of the graph, different coloured point relating to different sequence and when you click the certain coloured point it highlights point on the graph its related too

I was just wondering if either of these are possible using matplotlib, and if there are, are there any good websites to use or any specific way to go about this?

Thanks in advance

  • 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-17T23:17:37+00:00Added an answer on June 17, 2026 at 11:17 pm

    Use pick events.

    A simple examle that adds annotations to a scatter plot when you click on the markers:

    N = 12
    x = arange(N)
    y = arange(N)
    labels = [unichr(ord('a') + j) for j in range(N)]
    
    def onpick(event):
        print labels[event.ind[0]]
    
    
    fig = figure()
    ax1 = fig.add_subplot(111)
    col = ax1.scatter(x, y, 50,  picker=True)
    #fig.savefig('pscoll.eps')
    
    def onpick(event):
        ind = event.ind[0]
        print labels[ind]
        ax1.annotate(labels[ind], (x[ind], y[ind]), xytext=(x[ind] -1, y[ind] + 1),
                     arrowprops=dict(facecolor='black', shrink=0.05))
        fig.canvas.draw()
    
    fig.canvas.mpl_connect('pick_event', onpick)
    

    (this assumes you have started ipython with –pylab to get the imports right)

    You can replace the code in onpick with code that does what ever you want (and remember closures exist).

    This is a nice set of demos.

    Also see mpldatacursor

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

Sidebar

Related Questions

i have a scatter plot graph i would like each dot to have a
I have a graph with multiple scatter plots in same plot area.... like the
I have created a scatter graph with three plot spaces. One for two y-axis
Say if I have a scatter plot: dat = [1+(5-1).*rand(1000,1);89;92]; dat2 = dat+0.2; scatter(dat,dat2);
I have a set of data that I'm plotting as a scatter graph which
I would like my Scatter graph I am making with Core Plot library to
I'm using matplotlib in python to build a scatter plot. suppose I have the
I have two variables I want to plot on a scatter graph. I want
I have created a 2D scatter plot with the following commands: h = scatter(handles.axsScatterPlot,
I have a scatter graph and have implemented a highlighter type thing through matplotlib

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.