uifigure vs figure - advice please (2024)

103 views (last 30 days)

Show older comments

Justin on 8 Feb 2021

  • Link

    Direct link to this question

    https://support.mathworks.com/matlabcentral/answers/739217-uifigure-vs-figure-advice-please

  • Link

    Direct link to this question

    https://support.mathworks.com/matlabcentral/answers/739217-uifigure-vs-figure-advice-please

Edited: Adam Danz on 9 Feb 2021

We have a set of Matlab-based tools that all use a common set of GUI superclasses to provide a consistent look and feel plus certain common functionality. They pre-date uifigure so use figure to create the GUIs. There are some features that are only available in GUIs created using uifigure, e.g. scrollable panels, plus the compatibility with the App Designer.

As a test I changed our superclass to use uifigure and encountered a pile of warnings and errors when testing with one of our tools. Obviously I can work through those but expect I will find the same in our other tools using the same GUI superclasses.

So, my questions are:

1) Is there a guide specifically for converting figure-based GUIs to uifigure-based? A checklist of what properties/methods are different even. I couldn't find anything.

2) Any experience/comments on how much pain is involved? If it was just one tool I'd go for it but it's a suite of tools in our case.

5 Comments

Show 3 older commentsHide 3 older comments

Walter Roberson on 8 Feb 2021

Direct link to this comment

https://support.mathworks.com/matlabcentral/answers/739217-uifigure-vs-figure-advice-please#comment_1314492

  • Link

    Direct link to this comment

    https://support.mathworks.com/matlabcentral/answers/739217-uifigure-vs-figure-advice-please#comment_1314492

https://www.mathworks.com/matlabcentral/fileexchange/66087-guide-to-app-designer-migration-tool-for-matlab

Justin on 8 Feb 2021

Direct link to this comment

https://support.mathworks.com/matlabcentral/answers/739217-uifigure-vs-figure-advice-please#comment_1314512

  • Link

    Direct link to this comment

    https://support.mathworks.com/matlabcentral/answers/739217-uifigure-vs-figure-advice-please#comment_1314512

Edited: Justin on 8 Feb 2021

Thanks, there is some useful info there, although it is for GUIs created with GUIDE rather than created programatically.

Mario Malic on 8 Feb 2021

Direct link to this comment

https://support.mathworks.com/matlabcentral/answers/739217-uifigure-vs-figure-advice-please#comment_1314582

  • Link

    Direct link to this comment

    https://support.mathworks.com/matlabcentral/answers/739217-uifigure-vs-figure-advice-please#comment_1314582

This will be hard to answer for any of us, especially since you're talking about your own, specific class that you use to create GUIs. You can open uifigure and figure properties documentation side by side, you'll see that most of the properties are the different, also, how callbacks are written is different (I am not completely sure about this one, as I didn't write any for figure). Secondly, there might be an issue with the components that support figure but not uifigure. This doesn't seem like an easy task to do.

Justin on 9 Feb 2021

Direct link to this comment

https://support.mathworks.com/matlabcentral/answers/739217-uifigure-vs-figure-advice-please#comment_1317702

  • Link

    Direct link to this comment

    https://support.mathworks.com/matlabcentral/answers/739217-uifigure-vs-figure-advice-please#comment_1317702

I wasn't expecting a definitive answer so your thoughts were appreciated. It didn't seem trivial to me either and it was useful to have that confirmed.

It turned out that implementing a custom scrollable uitab in my existing figure-based GUI wasn't so difficult, so I've done that for now.

Will look to move over to uifigure at a later date as no doubt its native scrollable containers will be better than mine.

Adam Danz on 9 Feb 2021

Direct link to this comment

https://support.mathworks.com/matlabcentral/answers/739217-uifigure-vs-figure-advice-please#comment_1317762

  • Link

    Direct link to this comment

    https://support.mathworks.com/matlabcentral/answers/739217-uifigure-vs-figure-advice-please#comment_1317762

Edited: Adam Danz on 9 Feb 2021

My $0.02 on this in a recent similar question: [here].

One of the biggest differences is the HandleVisibility between uifigure ('off') and regular figures ('on') which requires using parent handles when adding anything to the figure but this is a good habbit to get into, anyway.

UIaxes (and uifgures) are still a bit slower to render than regular axes/figure [see this comparison from r2019b]. That comparison includes a lot of overhead in appdesigner but the difference still exists outside of appdesigner.

As you mentioned, there are a lot of nice features designed for uifigures and if you plan on using those features, it may be tipping point to your decision. If you're not planning on using those features, I see no reason to make the switch.

Sign in to comment.

Sign in to answer this question.

Answers (0)

Sign in to answer this question.

See Also

Categories

MATLABApp BuildingDevelop Apps ProgrammaticallyDevelop uifigure-Based Apps

Find more on Develop uifigure-Based Apps in Help Center and File Exchange

Tags

  • uifigure
  • matlab

Products

  • MATLAB

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.


uifigure vs figure - advice please (7)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom(English)

Asia Pacific

Contact your local office

uifigure vs figure - advice please (2024)
Top Articles
Latest Posts
Article information

Author: Tyson Zemlak

Last Updated:

Views: 6445

Rating: 4.2 / 5 (63 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Tyson Zemlak

Birthday: 1992-03-17

Address: Apt. 662 96191 Quigley Dam, Kubview, MA 42013

Phone: +441678032891

Job: Community-Services Orchestrator

Hobby: Coffee roasting, Calligraphy, Metalworking, Fashion, Vehicle restoration, Shopping, Photography

Introduction: My name is Tyson Zemlak, I am a excited, light, sparkling, super, open, fair, magnificent person who loves writing and wants to share my knowledge and understanding with you.