How to include subscript in the variable name in Biplot

5 views (last 30 days)
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

Answers (1)

arushi
arushi on 22 Aug 2024
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.

Categories

Find more on Dimensionality Reduction and Feature Extraction in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!