Make a histogram from a table
21 views (last 30 days)
Show older comments
Hi, I'm trying to make a histogram from a table but I can't find how to do it. This is my table of values; the 1st column is the y-axis and the 2nd column is the x-axis. How do I do this?
23.9860 23
17.8402 59
13.4646 86
50.1510 104
30.9001 151
28.7297 181
41.6877 213
56.1161 217
39.2818 263
20.5874 294
14.1804 313
22.7772 352
30.9727 391
27.3805 412
14.1550 442
12.8165 488
16.8457 499
33.3268 523
15.5860 554
30.3494 601
16.2556 615
40.1187 654
28.2005 693
23.1598 726
21.4945 762
9.3174 763
20.7460 822
54.1262 831
40.8851 882
50.3420 883
17.4587 932
14.0357 953
16.1450 981
13.5802 1032
13.9808 1043
34.9563 1092
12.1468 1106
25.5490 1141
20.4892 1174
36.1822 1219
37.4772 1220
37.0566 1258
13.5692 1288
36.7134 1337
15.7438 1349
21.0701 1399
19.5830 1422
32.3789 1449
17.3029 1467
32.0380 1520
35.6751 1539
32.9058 1570
16.5854 1594
18.3178 1635
37.3118 1647
25.0582 1693
21.6667 1720
18.6374 1738
17.2016 1787
50.7782 1826
32.9450 1829
34.4657 1877
46.7772 1893
64.1292 1937
18.3275 1977
13.5075 1987
26.2067 2024
35.9533 2043
31.6756 2086
17.8292 2117
13.2919 2155
18.2965 2181
44.5780 2204
42.0256 2240
78.4058 2269
55.8319 2286
35.8799 2325
39.5048 2345
26.1529 2384
27.2350 2414
16.1824 2436
21.7806 2467
8.8751 2524
29.8634 2546
10.0751 2578
29.5660 2605
39.1838 2648
61.7713 2680
59.2137 2695
40.0975 2716
22.6597 2764
32.0322 2779
19.9309 2816
20.3928 2834
18.5277 2869
23.3379 2908
22.5790 2940
28.1545 2983
30.1897 2984
28.6628 3026
32.6819 3060
22.2218 3080
27.9076 3126
12.2018 3146
24.8965 3170
20.2722 3204
27.0539 3255
22.8244 3284
16.6199 3316
18.8196 3328
33.1342 3355
12.1883 3405
18.5365 3435
34.9727 3457
18.0745 3483
20.5572 3511
23.5369 3559
23.0152 3574
28.3359 3597
13.2053 3628
19.9905 3667
20.1713 3710
39.1254 3739
57.5321 3754
15.5194 3795
23.6446 3817
51.0592 3849
31.2113 3873
32.1599 3923
18.9334 3930
16.6640 3962
45.6271 4006
39.3207 4049
46.9265 4050
43.7619 4094
61.5948 4125
24.6832 4142
45.1437 4184
33.4832 4227
14.6064 4238
21.6217 4269
14.4050 4296
18.0226 4328
23.9142 4382
18.3372 4412
21.3407 4437
31.9343 4447
26.9049 4480
24.2161 4535
34.8432 4545
40.0069 4574
30.0233 4621
41.3120 4633
16.8339 4672
10.2739 4700
18.1673 4743
35.0106 4780
53.0349 4788
41.9136 4840
38.9906 4843
45.2952 4876
39.2962 4921
36.4773 4937
41.9438 4979
13.8762 5006
22.0592 5044
26.8071 5069
18.8399 5097
31.7884 5138
16.6625 5175
30.5993 5176
44.8806 5231
34.5727 5256
20.4760 5286
7.6808 5305
17.9327 5342
35.9604 5374
22.0409 5417
23.1476 5433
21.5893 5456
32.6076 5496
50.3456 5520
73.6496 5571
85.9107 5572
29.3554 5610
20.6806 5634
20.6693 5663
28.3217 5705
17.9662 5748
23.2036 5776
17.1519 5787
21.2080 5815
9.4860 5857
26.3192 5882
18.9461 5925
46.9958 5961
38.0987 5970
18.1276 6004
19.1899 6043
26.4953 6063
13.8605 6109
16.5700 6130
25.7265 6170
21.3061 6195
37.6703 6233
33.9095 6264
27.2300 6275
22.6501 6304
44.5217 6336
23.7894 6382
13.0439 6402
19.1831 6435
39.1120 6456
18.1669 6492
13.5657 6522
20.6791 6552
16.1822 6599
32.0819 6616
21.7038 6642
23.2266 6676
30.6842 6714
27.5940 6743
31.8318 6775
24.4541 6791
32.8758 6827
17.0390 6870
36.9637 6889
22.9179 6911
24.1526 6963
33.1963 6997
28.7345 7004
35.3623 7046
24.7120 7086
69.3820 7095
26.9842 7130
23.4783 7162
29.9776 7210
44.5206 7236
25.2088 7263
13.6972 7285
20.9824 7323
33.1669 7357
20.8422 7375
62.9459 7416
22.2668 7436
33.6318 7475
20.5568 7495
27.9789 7544
23.4174 7566
13.6037 7595
10.2432 7625
27.9640 7648
24.2276 7675
49.2907 7714
35.4707 7735
46.1004 7785
58.5490 7810
17.5597 7842
15.7735 7869
13.3198 7886
20.8265 7934
32.5343 7965
18.3745 7979
27.1495 8032
20.7213 8065
21.8824 8086
42.9957 8114
41.1013 8146
45.6175 8187
42.6401 8188
33.4680 8224
14.3047 8262
22.3777 8303
7.8521 8339
20.4570 8346
16.0397 8372
22.3971 8422
29.2594 8446
30.2191 8465
32.6876 8508
53.9247 8546
20.5368 8578
27.1463 8598
14.5295 8643
19.0513 8657
14.1609 8683
13.6599 8712
8.4118 8746
38.1659 8771
12.1463 8801
18.0296 8836
20.8285 8882
9.1039 8917
15.2220 8934
45.0310 8978
43.0084 8986
27.4577 9022
38.4345 9055
21.6710 9100
22.4494 9121
25.8667 9156
78.6556 9186
81.7551 9216
44.7057 9251
47.3461 9257
40.5932 9302
46.0286 9330
15.2835 9359
25.0574 9379
15.1374 9436
17.0068 9457
24.9559 9496
30.3278 9516
28.3296 9542
32.6948 9584
47.0045 9599
46.4081 9628
20.3222 9649
17.6312 9709
35.5037 9739
18.3821 9749
17.1187 9773
11.5718 9808
8.2074 9838
20.1939 9884
37.0753 9911
42.7182 9933
26.4111 9957
21.6003 10006
24.8152 10023
24.3657 10055
32.7485 10096
17.4032 10132
22.1994 10152
27.8697 10181
10.0989 10225
14.2509 10255
25.0723 10285
33.3274 10318
45.6057 10325
30.1274 10367
51.6402 10389
17.3480 10411
19.6645 10453
20.6703 10486
27.4847 10507
38.4315 10546
17.3703 10566
18.9162 10595
36.9161 10645
18.8872 10667
29.9796 10711
23.2181 10734
31.7458 10754
11.9954 10792
14.9522 10826
31.4413 10847
15.8001 10883
19.6358 10920
12.2852 10946
22.9982 10980
27.1886 10995
33.5517 11046
31.7801 11071
20.3902 11108
52.2203 11138
41.2636 11145
34.1847 11171
68.0900 11220
14.9044 11248
10.9765 11273
24.2322 11295
40.2977 11327
9.2245 11384
21.2989 11407
15.8895 11430
23.7611 11465
36.6613 11486
9.2032 11522
23.2121 11551
19.8606 11583
26.3891 11610
34.6403 11644
15.9455 11686
0 Comments
Answers (1)
Cris LaPierre
on 25 Jan 2021
load Vals.mat
histogram2(Vals(:,1),Vals(:,2))
xlabel('X');
ylabel('Y');
zlabel('Counts')
0 Comments
See Also
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!