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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:39:19+00:00 2026-06-12T05:39:19+00:00

my problem is I want to have a box for additional bigger comments to

  • 0

my problem is I want to have a box for additional bigger comments to the graph.
How can I create this box, so that it will be always on the right bottom side outside of my graph, and it will be automatically adjusting its size to the amount of text inside? Also, if I will have longer text, I need it to be split into more lines, not just one line extremely long.

I use it like that, however I have a poor control over what is happening, this just creates a certain size in a certain place, text is cut.. please help 🙂

x = rand(110)*100;
y = x;
plot(x,y)
MyBox = uicontrol('style','text')
set(MyBox,'String','optional longer information to be put into diagram')
set(MyBox,'Position',[10,0,40,10])
  • 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-12T05:39:20+00:00Added an answer on June 12, 2026 at 5:39 am

    I am afraid you can not do that automatically – Text boxes do not use callbacks. From the documentation:

    Users cannot change static text interactively. Static text controls do not activate callback routines when clicked.

    What you can do is call textwrap function, which will automatically wrap the text you pass to it and return new Text box position:

    MyBox = uicontrol('style','text');
    % set initial position - first three values are kept constant after wrap, the hight can be changed
    set(MyBox,'Position',[10,10,30,10])
    
    % adjust the height of your Text box and wrap the text
    [outstring,newpos] = textwrap(MyBox,{'optional longer information to be put into diagram'});
    % set new position and text
    set(MyBox,'Position',newpos, 'String', outstring)
    

    You will have to call textwrap and set(…) yourself whenever you change the string in the text box.

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

Sidebar

Related Questions

I have three problems: I want to create resizable shapes with box bounding... I
with my RCP program I have the problem that I want to have more
I have this problem: I want to generate a new source code file from
My problem is that I want to have a tab bar view with its
I have created this Fiddle with this code: This is my problem I want
I have the following problem that I want to solve in awk. I have
I have a popup box that retrieves content data via AJAX and displays this
This should be a very simple problem you would think. I have a box
I have combo box that is bounded to binding source. The problem is when
This seems like a relatively simple problem. I want to have the data 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.