How to plot with t-SNE in MATLAB from 5 elements composition into 2 dimensions?
이전 댓글 표시
I would like to make a figure like the below figure!

T-distributed stochastic neighbor embedding (t-SNE) used in the figure to visualize across the composition space in two dimensions (I have a 5 element composition space for the alloy and entropy of mixing calculate from the composition).
Entropy of mixing=;
We have the data for the entropy of mixing and compositions in the Excel attached file.
My question is now how to visualize from composition space with 5 elements into just two dimensions! The results should be like a pentagon, because the attached picture is for a 6 elements alloy and is like a hexagon.
P.mat attached matrix contains x1,x2,x3,x4,x5,.
How to make a t-SNE from P matrix?
Best
Majid
답변 (1개)
Akanksha
2025년 3월 1일
The resolution to visualize from composition space with 5 elements into 2D can be achieved using the following code :
%1. Load your Nx5 data matrix: P. Also, ensure P is in your MATLAB workspace.
%2. Run t-SNE
Y = tsne(P, 'Perplexity', 30, 'Exaggeration', 5);
%3. Plot the results, coloring by S (an Nx1 vector)
figure;
scatter(Y(:,1), Y(:,2), 50, S, 'filled');
colorbar;
xlabel('t-SNE 1');
ylabel('t-SNE 2');
title('t-SNE Projection of 5-element Compositions');
I have tested this code on small sample data set and successfully generated a meaningful 2D scatter plot, where each point is coloured by its associated property value.

Below I have also attached relevant MATLAB Documentation that will help you :
Hope this helps. Thanks.
카테고리
도움말 센터 및 File Exchange에서 Graphics에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!