I have something like this values 25 is the X and remaing four values after that consitutes Y ..similarly for 50,100 ..250etc..how shall i pplot all these togetther.such like i get corresponding maps for each set of X.
25 646 490 700 669
50 1530 1388 1500 1666
75 2586 3260 882 1704
100 4411 4415 2419 2142
125 3002 2142 3409 3000
150 2027 1923 1339 1041
175 1250 2678 3260 3125
200 1388 2272 2678 1704
225 1339 2419 2884 1785
250 1470 2777 3260 1744

2 commentaires

KSSV
KSSV le 14 Sep 2020
Use plot. Wjat you expect actually?
Ramesh Bala
Ramesh Bala le 14 Sep 2020
y1 = [25 646 490 700 669 ]; i have like this where the plot shows error

Connectez-vous pour commenter.

 Réponse acceptée

Walter Roberson
Walter Roberson le 14 Sep 2020
bar(YourMatrix(:,1), YourMatrix(:,2:end))

6 commentaires

Ramesh Bala
Ramesh Bala le 14 Sep 2020
thanks walter,but it will give me an error
y1 = [25 646 490 700 669 ];
bar ( y1(:,1), y1(:,2:end) );
where y1(:,1) is the X and y1(:,2:end) ) are my Y values
YourMatrix = [
25 646 490 700 669
50 1530 1388 1500 1666
75 2586 3260 882 1704
100 4411 4415 2419 2142
125 3002 2142 3409 3000
150 2027 1923 1339 1041
175 1250 2678 3260 3125
200 1388 2272 2678 1704
225 1339 2419 2884 1785
250 1470 2777 3260 1744 ];
Ramesh Bala
Ramesh Bala le 14 Sep 2020
Thank you this bar works.
Is it possible to pile and differentiate clearly to make 2D plot ,because a plot of it instead of bar is not a corect procedure.
Walter Roberson
Walter Roberson le 14 Sep 2020
No, you cannot make a clear 2D plot from that.
If you happened to have a set of Y values corresponding to columns 2, 3, 4, 5, such as that they are respectively for Y = 5 7 9 11, then you could create a 2D image by using pcolor() providing the X data from column 1, and the Y data (that is external to what you have posted), and using columns 2 to 5 as the Z data.
Ramesh Bala
Ramesh Bala le 14 Sep 2020
oh thanks ! yes you are right,I tried but it was not clear as they are not equal in nature and giving wrong plots.
Thanks again !
plot(YourMatrix(:,1), YourMatrix(:,2:end))
perhaps.

Connectez-vous pour commenter.

Plus de réponses (1)

VBBV
VBBV le 14 Sep 2020
Modifié(e) : Walter Roberson le 14 Sep 2020
X= 25:25:100;
Y = [646 490 700 669;1530 1388 1500 1666;2586 3260 882 1704;4411 4415 2419 2142];
bar(X,Y,'stacked');
I just shown upto 4 rows here you can add as the number of rows you want

Catégories

En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by