How to include subscript in the variable name in Biplot

6 次查看(过去 30 天)
Hallo:
I am doing Principal component analysis and I need to add subscripts in my variable name while plotting Biplot.Below is the code I am using:
figure
biplot(coefs(:,1:2),'VarLabels',...
{'X_{1}' 'X_{2}' 'X_{3}' 'X_{4}''X_{5}' 'X_{6}' 'X_{7}' 'X_{8}''X_{9}' 'X_{10}' 'X_{11}' 'X_{12}'})
But names do not appear in the biplot. But interestingly, I tested with 6 variables instead of 12 and my code worked.
Please help

回答(1 个)

arushi
arushi 2024-8-22
Hi Khandker,
The issue you're facing with variable names not appearing in the biplot when using 12 variables could be due to a syntax error or plot size constraints.
Here's the corrected version of your code with proper syntax:
figure;
biplot(coefs(:,1:2), 'VarLabels', ...
{'X_{1}', 'X_{2}', 'X_{3}', 'X_{4}', 'X_{5}', 'X_{6}', ...
'X_{7}', 'X_{8}', 'X_{9}', 'X_{10}', 'X_{11}', 'X_{12}'});
Hope this helps.

类别

Help CenterFile Exchange 中查找有关 Dimensionality Reduction and Feature Extraction 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by