LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Converting a Histogram data into Scatter Plot data (https://www.linuxquestions.org/questions/linux-software-2/converting-a-histogram-data-into-scatter-plot-data-668271/)

kushalkoolwal 09-08-2008 01:52 AM

Converting a Histogram data into Scatter Plot data
 
Hello,

I have a sample data in file which is good for plotting histogram i.e. I have the "Value" column and the "Freq".

Here is the sample data:
Code:

Value        Frequency
10        2
8        2
5        1
4        10
3        8
2        7
1        68
0        2

I am able to plot a histogram with the following gnuplot code:
Code:

set terminal pbm color
set output "hist.pbm"
set title "Latency Histogram"
set xlabel "Number of Data Points"
set ylabel "Latency in usecs"
plot [0:100] [0:10] "hist.dat" with steps


Now I would like to convert this data into a format which will help me in plotting a scatterplot. How can I modify the above gnuplot code or the data file to plot a scatterplot.

I know my explanation or language may not be clear but I would be happy to clarify it.

Any help will be appreciated...Thanks

weibullguy 09-08-2008 10:47 AM

As you know, a scatter plot is a plot of response variable vs. explanatory variable. Given your data set, I would presume Value is the response variable and the explanatory variable is missing. I am presuming the "Latency in usec" is in response to something and that something is not reported in your data set.

If you created a scatter plot with your data there would be multiple points one on top of each other. For example, at response value 1, there would be 68 points. It would look like a very bold point, but would still only be one point. A scatter plot with that data would look no different than your bar plot except the bars would be replaced by single point.

kushalkoolwal 09-08-2008 01:19 PM

Quote:

Originally Posted by weibullguy (Post 3273427)
As you know, a scatter plot is a plot of response variable vs. explanatory variable. Given your data set, I would presume Value is the response variable and the explanatory variable is missing. I am presuming the "Latency in usec" is in response to something and that something is not reported in your data set.

If you created a scatter plot with your data there would be multiple points one on top of each other. For example, at response value 1, there would be 68 points. It would look like a very bold point, but would still only be one point. A scatter plot with that data would look no different than your bar plot except the bars would be replaced by single point.


You are right. Actually the column Frequency can also be read as "Number of Cycles"....So for example, in the sample data there are 100 values - each for 1 cycle. So there were 100 cycles in the program and I have value recorded for every cycle. Hope this makes things clear?

Quote:

If you created a scatter plot with your data there would be multiple points one on top of each other. For example, at response value 1, there would be 68 points. It would look like a very bold point, but would still only be one point.
Yes I would like to try that. How can I do that?


Thank you very much for your response..


All times are GMT -5. The time now is 03:36 PM.