Data extraction from stacked plot

11 vues (au cours des 30 derniers jours)
Ajai Singh
Ajai Singh le 14 Juil 2021
Commenté : Ajai Singh le 14 Juil 2021
I want to extract data from the stacked plot generated , by extracting data i mean that whenever the user clicks on the staked plot , a set of values are displayed at the intersection of the plot and vertical line ( please refer to the figure to get more understanding of what i mean) , i want to extract these values and then write them to an excel sheet . Please help me to do that.
( I want the values displayed in the boxes to be written in an excel file )
Thank you.

Réponse acceptée

ANKUR KUMAR
ANKUR KUMAR le 14 Juil 2021
Modifié(e) : ANKUR KUMAR le 14 Juil 2021
Let us load random data.
tbl = readtable('patients.xls');
stackedplot(tbl,{'Height','Weight','Systolic','Diastolic'})
There must be value of x over which you wish to extarct all the values. Let us take 50 in this case.
values=[tbl.Height tbl.Weight tbl.Systolic tbl.Diastolic];
values_x=1:size(values,1);
extracted_values=values(values_x==50,:)
extracted_values = 1×4
67 179 124 78
  1 commentaire
Ajai Singh
Ajai Singh le 14 Juil 2021
Thank you for the answrer. appreciate it, but can i get the value of x when the user clicks on the stacked plot ?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by