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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:33:55+00:00 2026-06-11T00:33:55+00:00

I wrote a code that shows a figure devided to 2 parts; the first

  • 0

I wrote a code that shows a figure devided to 2 parts;
the first one showing the main image, and the second one is a slider showing the rest of the images.

Now I need to add text to the main part (Like “Help” or “guide” text).
How can I do it?

This is my main sub-code:

    %# design GUI
    numSubs = 10; % Num of sub-images.
    mx = numImgs-numSubs+1;
    hFig = figure('Menubar','none');

    % The Main Image:
       hAx = axes('Position',[0 0.3 1 0.8], 'Parent',hFig);
hMainImg = imshow(img, 'Parent',hAx);

    % the slider
    hPanel = uipanel('Position',[0 0.04 1 0.26], 'Parent',hFig);
    uicontrol('Style','slider', 'Parent',hFig, ...
        'Callback',@slider_callback, ...
        'Units','normalized', 'Position',[0 0 1 0.04], ...
        'Value',1, 'Min',1, 'Max',mx, 'SliderStep',[1 10]./mx);


    subImg = zeros(numSubs,1);
    for i=1:numSubs
        %# create axis, show frame, hookup click callback
        hAx = axes('Parent',hPanel, ...
            'Position',[(i-1)/numSubs 0 1/numSubs 1]);
        % Load img number i
        name=frames(i).name;
        img=imread(name,'jpg');
        subImg(i) = imshow(img, 'Parent',hAx);
        value = i;
        set(subImg(i), 'ButtonDownFcn',{@click_callback value})
        axis(hAx, 'normal')
        hold off;
    end

Any suggestions?
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-11T00:33:57+00:00Added an answer on June 11, 2026 at 12:33 am

    Use this construction:

    hT = uicontrol('style', 'text', 'string', 'HELLO WORLD', 'position', [...])
    

    It will create static text in the figure at position position. You can use all the regular options for uicontrols like 'parent' or 'units'.

    However, since your image is in an axis, the better/easier way to do it is using

    hT = text(X, Y, 'HELLO WORLD')
    

    with X and Y the desired coordinates of the text in the axes.

    You can set additional options via set:

    set(hT, 'color', 'r', 'backgroundcolor', 'k', 'fontsize', 10, ...)
    

    You can get a list of all options by issuing set(hT) on a mock text object.

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

Sidebar

Related Questions

I recently wrote code that didnt work as i would expect, it was: message
I wrote some code that activity starts a service to get some text from
I wrote this code that compiles on Solaris gcc it works fine too for
So, here's the problem. I wrote a code that opens a div based on
Years ago, I wrote a code template that took a few simple parameters (points)
I wrote some code in VHDL that is expected to look at a rotory
I wrote this piece of code that is supposed to redirect something written on
I have some python code that I wrote to convert a python list into
I was thinking about a code that I wrote a few years ago in
here is a small peice off code that i wrote. But I am not

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.