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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:55:42+00:00 2026-05-17T01:55:42+00:00

I have a plot which has timestamps on the x-axis and some signal data

  • 0

I have a plot which has timestamps on the x-axis and some signal data on the y-axis. As a documentation I want to put timestamped pictures in relation to specific points in the plot. Is it possible to draw a line in a plot to a picture in a sequence of pictures below the plot?

  • 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-17T01:55:43+00:00Added an answer on May 17, 2026 at 1:55 am

    This demo from the matplotlib gallery shows how to insert pictures, draw lines to them, etc. I’ll post the image from the gallery, and you can follow the link to see the code.
    enter image description here

    And here’s the code (from version 2.1.2):

    import matplotlib.pyplot as plt
    import numpy as np
    
    from matplotlib.patches import Circle
    from matplotlib.offsetbox import (TextArea, DrawingArea, OffsetImage,
                                      AnnotationBbox)
    from matplotlib.cbook import get_sample_data
    
    
    if 1:
        fig, ax = plt.subplots()
    
        # Define a 1st position to annotate (display it with a marker)
        xy = (0.5, 0.7)
        ax.plot(xy[0], xy[1], ".r")
    
        # Annotate the 1st position with a text box ('Test 1')
        offsetbox = TextArea("Test 1", minimumdescent=False)
    
        ab = AnnotationBbox(offsetbox, xy,
                            xybox=(-20, 40),
                            xycoords='data',
                            boxcoords="offset points",
                            arrowprops=dict(arrowstyle="->"))
        ax.add_artist(ab)
    
        # Annotate the 1st position with another text box ('Test')
        offsetbox = TextArea("Test", minimumdescent=False)
    
        ab = AnnotationBbox(offsetbox, xy,
                            xybox=(1.02, xy[1]),
                            xycoords='data',
                            boxcoords=("axes fraction", "data"),
                            box_alignment=(0., 0.5),
                            arrowprops=dict(arrowstyle="->"))
        ax.add_artist(ab)
    
        # Define a 2nd position to annotate (don't display with a marker this time)
        xy = [0.3, 0.55]
    
        # Annotate the 2nd position with a circle patch
        da = DrawingArea(20, 20, 0, 0)
        p = Circle((10, 10), 10)
        da.add_artist(p)
    
        ab = AnnotationBbox(da, xy,
                            xybox=(1.02, xy[1]),
                            xycoords='data',
                            boxcoords=("axes fraction", "data"),
                            box_alignment=(0., 0.5),
                            arrowprops=dict(arrowstyle="->"))
    
        ax.add_artist(ab)
    
        # Annotate the 2nd position with an image (a generated array of pixels)
        arr = np.arange(100).reshape((10, 10))
        im = OffsetImage(arr, zoom=2)
        im.image.axes = ax
    
        ab = AnnotationBbox(im, xy,
                            xybox=(-50., 50.),
                            xycoords='data',
                            boxcoords="offset points",
                            pad=0.3,
                            arrowprops=dict(arrowstyle="->"))
    
        ax.add_artist(ab)
    
        # Annotate the 2nd position with another image (a Grace Hopper portrait)
        fn = get_sample_data("grace_hopper.png", asfileobj=False)
        arr_img = plt.imread(fn, format='png')
    
        imagebox = OffsetImage(arr_img, zoom=0.2)
        imagebox.image.axes = ax
    
        ab = AnnotationBbox(imagebox, xy,
                            xybox=(120., -80.),
                            xycoords='data',
                            boxcoords="offset points",
                            pad=0.5,
                            arrowprops=dict(
                                arrowstyle="->",
                                connectionstyle="angle,angleA=0,angleB=90,rad=3")
                            )
    
        ax.add_artist(ab)
    
        # Fix the display limits to see everything
        ax.set_xlim(0, 1)
        ax.set_ylim(0, 1)
    
        plt.show()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data which I want to plot in cumulative function. The R
I have data in some text file which has let's say 10000 rows and
Say, I have a variable rv which has some numerical value. Now, I want
I have a scatter plot in R (with ggplot2). The data has a numeric
I have some data plotted which includes some limits on each subplot: Both axes
I have a data.frame called series_to_plot.df which I created by combining a number of
I have two plots displaying supply and demand, and one plot in which I
I have the following code which lets the user plot two points on a
With this approach. I have a line plot graph. I want to plot 'two'
I have the following data set that I am trying to plot with ggplot2,

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.