Why is my subplot title in bold?

Hi, I encounter a strange plotting behaviour. I use the command:
sgtitle
to insert a title above my subplots. Using this command, some figures appear to plot the title in bold, while others show 'normal' text. I prefer the latter. Please see the figures below. It really looks like a bug to me. It is a minor issue, but i would like to get all titles in plain text instead of bold. How can i fix this?
set(0,'defaulttextinterpreter','latex');
%% Code for Bold plot: (unprefered)
subplot(1,2,2); hold on
sgtitle('Steady Aerodynamic Model');
for k=1:1:length(real_p)
plot(v(j),real_p(k),'.k','MarkerSize',6);
end
xlabel(' v [m/s]'); ylabel( 'real $${\sigma}$$');grid on; hold off
subplot(1,2,1); hold on
for l=1:1:length(imag_p)
plot(v(j),imag_p(l),'.k','MarkerSize',6);
end
xlabel(' v [m/s]'); ylabel( 'imag $${\omega}$$');grid on; ylim([0 50]);
hold off
%% code for 'normal plan text' plot (prefered:)
sgtitle({'Steady Aerodynamic Model Theodorsen'})
subplot(1,2,1); hold on
plot(v,imag(p_final),'.k')
xlabel(' v [m/s]'); ylabel( 'imag $${\omega}$$');grid on; ylim([0 50]);
subplot(1,2,2); hold on
plot(v,real(p_final),'.k')
xlabel(' v [m/s]'); ylabel( 'real $${\sigma}$$');grid on;
Bold:
Not bold (prefered):

7 commentaires

Rik
Rik le 12 Juin 2020
Modifié(e) : Rik le 12 Juin 2020
Can you make a MWE so we can run your code without any other dependencies and can reproduce your issue? The code you posted has several missing variables (including the overwriting of the imaginary unit j with a non-zero real integer).
If you have the bioinformatics toolbox you could also use suptitle.
Rik
Rik le 12 Juin 2020
I can't reproduce your screenshots with R2020a. So apparently something changed in sgtitle in the interim.
Jurrien Plijter
Jurrien Plijter le 12 Juin 2020
Interesting, i will consider updating my Matlab version then. Thank you. (So i quess it is indeed a bug.)
Rik
Rik le 13 Juin 2020
Original question body retrieved from Google cache:
Hi, I encounter a strange plotting behaviour. I use the command:
sgtitle
to insert a title above my subplots. Using this command, some figures appear to plot the title in bold, while others show 'normal' text. I prefer the latter. Please see the figures below. It really looks like a bug to me. It is a minor issue, but i would like to get all titles in plain text instead of bold. How can i fix this?
set(0,'defaulttextinterpreter','latex');
%% Code for Bold plot: (unprefered)
subplot(1,2,2); hold on
sgtitle('Steady Aerodynamic Model');
for k=1:1:length(real_p)
plot(v(j),real_p(k),'.k','MarkerSize',6);
end
xlabel(' v [m/s]'); ylabel( 'real $${\sigma}$$');grid on; hold off
subplot(1,2,1); hold on
for l=1:1:length(imag_p)
plot(v(j),imag_p(l),'.k','MarkerSize',6);
end
xlabel(' v [m/s]'); ylabel( 'imag $${\omega}$$');grid on; ylim([0 50]);
hold off
%% code for 'normal plan text' plot (prefered:)
sgtitle({'Steady Aerodynamic Model Theodorsen'})
subplot(1,2,1); hold on
plot(v,imag(p_final),'.k')
xlabel(' v [m/s]'); ylabel( 'imag $${\omega}$$');grid on; ylim([0 50]);
subplot(1,2,2); hold on
plot(v,real(p_final),'.k')
xlabel(' v [m/s]'); ylabel( 'real $${\sigma}$$');grid on;
Bold:
Not bold (prefered):
Rik
Rik le 13 Juin 2020
Deleted comment:
clear all; clc; close all; format long g;
set(0,'defaulttextinterpreter','latex');
figsize_x=350;
figsize_y=650;
%% input parameters
%perc=0.7012; %typical section location for matching bending frequency
perc=0.6346; %typical section location for matching torsion frequency
X=fprintf('Location typical section = %f',perc);disp(X);
L=16*perc;
% Flight parameters
rho=0.0889;
% Mass parameters
ma = 0.75;
Icg_theta = 0.1;
% Geometric parameters
span = 16;
b = 0.5;
a = 0;
c = 1/b;
x_theta = 0; %=0 % - = CG voor EA, Vf inc. + = CG achter EA, Vf dec.
x_beta = 0;
S = 2*b;
% Stiffness parameters
EI = 2e4;
GJ = 1e4;
K_h = 3*EI/(L^4);%/span;
K_theta = GJ/L^2;%/span;
% Ms parameters
m = ma;
S_theta = ma*x_theta*b;
S_beta = 0;
I_theta = ma*(x_theta*b)^2+Icg_theta;
% create structural matrices
Ms = [m S_theta ;
S_theta I_theta ;];
Ks = [K_h 0 ;
0 K_theta ;];
%% Flutter steady aerodynamic model
v=0.1:1:60;
figure('position', [100, 100, figsize_y, figsize_x])
for j=1:1:length(v)
v(j);
q=0.5*rho*v(j)^2;
a0=K_h*(K_theta-q*S*2*pi*b*(0.5+a));
a1=0;
a2=m*K_theta+I_theta*K_h-(m*(0.5+a)*b+S_theta)*q*S*2*pi;
a3=0;
a4=m*I_theta-S_theta^2;
det_acoef=a2^2-4*a4*a0;
pol=[a4 a3 a2 a1 a0];
p=roots(pol);
imag_p=imag(p);
real_p=real(p);
subplot(1,2,2); hold on
for k=1:1:length(real_p)
plot(v(j),real_p(k),'.k','MarkerSize',6);hold on;
end
xlabel(' v [m/s]'); ylabel( 'real $${\sigma}$$');grid on; hold off
subplot(1,2,1); hold on
for l=1:1:length(imag_p)
plot(v(j),imag_p(l),'.k','MarkerSize',6);hold on;
end
xlabel(' v [m/s]'); ylabel( 'imag $${\omega}$$');grid on; ylim([0 50]);
hold off
sgtitle('Steady Aerodynamic Model');
t.FontWeight='normal';
end
syms ps
p_final = [];
figure('position', [100, 100, figsize_y, figsize_x])
for j = 1:1:length(v)
mat_x=pi.*rho.*v(j)^2.*[0 2*b; 0 -b^2];
A=ps^2*Ms+Ks+mat_x;
det_A=det(A);
poly=double(sym2poly(det_A));
p_add=roots(poly);
p_final=[p_final p_add];
end
for z=1
sgtitle({'Steady Aerodynamic Model Theodorsen'})
subplot(1,2,1); hold on
plot(v,imag(p_final),'.k')
xlabel(' v [m/s]'); ylabel( 'imag $${\omega}$$');grid on; ylim([0 50]);
subplot(1,2,2); hold on
plot(v,real(p_final),'.k')
xlabel(' v [m/s]'); ylabel( 'real $${\sigma}$$');grid on;
end
madhan ravi
madhan ravi le 13 Juin 2020
Thank you Rik!
Rena Berman
Rena Berman le 12 Oct 2020
(Answers Dev) Restored edit

Connectez-vous pour commenter.

Réponses (1)

madhan ravi
madhan ravi le 12 Juin 2020

0 votes

2 commentaires

Jurrien Plijter
Jurrien Plijter le 12 Juin 2020
Doesn't change anything. If i select 'bold' by that setting, the title appears even bolder than it already is.
madhan ravi
madhan ravi le 12 Juin 2020
Yes you’re right didn’t test it.

Connectez-vous pour commenter.

Produits

Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by