What is the best way to graph scatter plots in C++?
Do you write data to a file and use another tool? Is there a library like matplotlib in Python?
c : color, sequence, or sequence of color, optional, default: 'b' The marker color. Possible values: A single color format string. A sequence of color specifications of length n.
If the points on the scatter plot seem to be scattered randomly, there is no relationship or no correlation between the variables. When there is a positive or negative relationship between your variables, you can draw a line of best fit.
The closer the data points come to forming a straight line when plotted, the higher the correlation between the two variables, or the stronger the relationship. If the data points make a straight line going from near the origin out to high y-values, the variables are said to have a positive correlation.
I always write out data and then using gnuplot to create my graphs. It is by far the best way I have found of producing graphs in a variety of formats: eps, png, jpeg, xpm, you name it.
gnuplot
will do scatter plot very easily. Provided the x
and y
values are in 2 space-separated columnss, then
plot "data.txt" using 1:2
Will give you a quick scatter plot. Then you can adjust it and what not using other gnuplot commands.
If you are involved in sciences, then learning gnuplot
will be very valuable to you. It kicks the crap out of doing excel plots for sure and it eases the task of making plots to include in papers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With