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 comentarios

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?

Iniciar sesión para comentar.

Respuestas (2)

Frederic
Frederic el 8 de Jul. de 2021
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]);

Categorías

Más información sobre Line Plots en Centro de ayuda y File Exchange.

Productos

Versión

R2017b

Preguntada:

el 18 de Jun. de 2018

Respondida:

el 8 de Jul. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by