Using UIPanel, how do I make a title with multiple lines?

I am using the uipanel function to add a supertitle to my subplots https://www.mathworks.com/help/matlab/creating_plots/combine-multiple-plots.html#d119e2898, however, I can only have the title be one line. Is there a way to span the title across two or more lines?
Here's my code:
f = figure(13);
p = uipanel('Parent',f,'BorderType','none');
p.Title = {[cndname ' - CT to Blue Fluoro']; 'Bead Position Error vs Radial Bead Distance'};
p.TitlePosition = 'centertop';
p.FontSize = 11;
p.FontWeight = 'bold';
Additionally, is there a way to make certain word in the title a different color such as in this example - https://www.mathworks.com/help/matlab/ref/title.html#btpl69n-1_1. Once again, the uipanel function doesn't allow me to do this.

2 commentaires

My experiments suggest that the title property is not interpreted, so tex and latex and HTML cannot be used, and that only the first line of a cell array will be displayed. So I do not think it is possible except perhaps by going in at the java level
Thanks for the quick reply. Is there an alternative that can easily create a supertitle for subplots?

Connectez-vous pour commenter.

Réponses (2)

Frederic
Frederic le 8 Juil 2021

0 votes

Example
fig = uifigure('Position',[100 100 200 200],...
'Name','My fig title');
title_line = "line1 ";
title_line = title_line + newline + "line2";
zone4 = uipanel(fig,...
'Title',title_line,'FontSize',12,...
'BackgroundColor','white',...
'Position',[25 25 75 150]);

Catégories

En savoir plus sur Line Plots dans Centre d'aide et File Exchange

Produits

Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by