How do I plot a histogram for large data sets?
显示 更早的评论
Can anyone possibly help me with writing a code for my histogram?
I need to use matlab but I'm not familiar with histograms and the information page is not helping too much.
Essentially I have 355 data points, then the raw data for all those data points.
I want to plot Number of Cells against Fluorescence Intensity
x (Fluorescence Intensity)
y (Number of cells)
I can determine the directory and file name, but I do not know how to write the code to generate the histogram after that.
The data will be imported from an excel file, just FYI.
6 个评论
James Browne
2019-6-12
Can you clarify what you data format is? Do you mean to say that you have 355 data files of raw data? Do the files have headers? What are the dimensions of thes files? Also How do fluorescence intensity and number of cells relate to your data (i.e. is number of cels a column or row value)? What is the file extension of your data files? Is it .xls, .csv...? It would be really difficult to help you get started with writing a code without knowing things like the dimensions of your data, how it is organized, etc.
Also, a histogram essentially displays the number of occurences number ranges (bins) in a data set so you will always have some number ranges (bins) on the x-axis and the count (number of times that the data fell into each bin in the data set). So if you are looking to plot your x vs. y or something like that, a histogram is not the tool to be using.
Fope Ayo
2019-6-13
Prasanth Sikakollu
2019-6-13
Is this what you are looking for?

Fope Ayo
2019-6-13
Prasanth Sikakollu
2019-6-13
This is actually not a histogram. It is a bar graph you are looking for.
Fope Ayo
2019-6-13
回答(1 个)
Prasanth Sikakollu
2019-6-13
The basic difference between histogram and bar chart is:
Histogram refers to a graphical representation; that displays data by way of bars to show the frequency of numerical data. A bar graph is a pictorial representation of data that uses bars to compare different categories of data.
A Bar chart is apt for your problem. This should work.
dataset = xlsread('histogram data for glucose.xlsx');
x = dataset(:,1);
y = dataset(:,2);
bar(x,y);
类别
在 帮助中心 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!