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

  • Home
  • SEARCH
  • 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 783065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:29:14+00:00 2026-05-14T20:29:14+00:00

I wrote a small MATLAB program with a gui. Inside the gui I have,

  • 0

I wrote a small MATLAB program with a gui. Inside the gui I have, among other things, a plot in which the user should be able to select two points. For this I use the function ginput, which creates a crosshair for selection. Unfortunatley the crosshair extends the whole window and is not restricted to the plot, which doesn’t look nice and is confusing for the user. How can the crosshair be restricted only to the area of 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-14T20:29:15+00:00Added an answer on May 14, 2026 at 8:29 pm

    Try using getpts, which doesn’t create the crosshair; with getpts, you can also specify the axes you want the user to select from, as in

    [x,y] = getpts(ax);
    

    The only trouble with getpts is there’s no way to limit it to exactly two points. But it does have the nice feature that the user can undo point selection by hitting DELETE, and confirm points by hitting ENTER.

    looking closely at the ginput documentation, the behavior you describe is intended, and apparently unavoidable

    from

    doc ginput
    

    Clicking an axes makes that axes the current axes. Even if you set the current axes before calling ginput, whichever axes you click becomes the current axes and ginput returns points relative to that axes. If you select points from multiple axes, the results returned are relative to the coordinate system of the axes they come from.

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

Sidebar

Ask A Question

Stats

  • Questions 507k
  • Answers 507k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Well, sort of. You can do: if (is_array($var) || ($var… May 16, 2026 at 4:11 pm
  • Editorial Team
    Editorial Team added an answer I would think that you just dont call [self dismissModalViewControllerAnimated:YES];… May 16, 2026 at 4:11 pm
  • Editorial Team
    Editorial Team added an answer Set error reporting to E_ALL and ensure that display_errors in… May 16, 2026 at 4:11 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm trying to write a program that cleans data, using Matlab. This program takes
I have been working lately on a number of iterative algorithms in MATLAB, and
I wrote a small application using iPhone 3.x sdk. The app works well on
I wrote a small script for work and when developing it everything was fine
I wrote a small shell script based on an example I found here: https://bbs.archlinux.org/viewtopic.php?id=36305
A series of applications I'm writing require that the user be able to read
I've written a small CUDA program on my macbook pro and now tried it
I have a problem with getting scrollbar positions. Is it possible to get the
In my project I found a piece of code in which a method was
I'm trying to profile the startup time of my application, so I wrote a

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.