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
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!