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

8 Ansichten (letzte 30 Tage)
Ledoux Laboratory
Ledoux Laboratory am 18 Jun. 2018
Beantwortet: Frederic am 8 Jul. 2021
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 Kommentare
Walter Roberson
Walter Roberson am 18 Jun. 2018
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
Ledoux Laboratory
Ledoux Laboratory am 18 Jun. 2018
Thanks for the quick reply. Is there an alternative that can easily create a supertitle for subplots?

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Walter Roberson
Walter Roberson am 18 Jun. 2018

Frederic
Frederic am 8 Jul. 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]);

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by