How to plot with t-SNE in MATLAB from 5 elements composition into 2 dimensions?

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

Answers (1)

Akanksha
Akanksha on 1 Mar 2025
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.

Categories

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

Products

Community Treasure Hunt

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

Start Hunting!