Create A Scatterplot
Create A Scatterplot
ABSTRACT:
A scatter plot is a chart type that is normally used to observe and visually display the relationship between
variables. The values of the variables are represented by dots. The positioning of the dots on the vertical
and horizontal axis will inform the value of the respective data point; hence, scatter plots make use of
Cartesian coordinates to display the values of the variables in a data set. Scatter plots are also known as
scattergrams, scatter graphs, or scatter charts.
A scatter plot is a chart type that is normally used to observe and visually display the relationship between
variables. It is also known as a scattergram, scatter graph, or scatter chart.
The data points or dots, which appear on a scatter plot, represent the individual values of each of the data
points and also allow pattern identification when looking at the data holistically.
The most common use of the scatter plot is to display the relationship between two variables and observe
the nature of such a relationship. The relationships observed can either be positive or negative, non-linear
or linear, and/or, strong or weak.
Based on the pattern of the data points, you can determine the correlation between the two variables –
Positive Correlation – In a positive correlation, as one variable increases, the other variable also
tends to increase. Similarly, as one variable decreases, the other variable tends to decrease. In this
scenario, the points form an upward-sloping line.
Negative Correlation – In a negative correlation, as one variable increases, the other variable also
tends to decrease. Similarly, as one variable decreases, the other variable tends to increase. In this
scenario, the points form a downward-sloping line.
No Correlation – In the case of no correlation, there is no apparent relationship between the two
variables. Changes in one variable do not predict changes in the other variable. The data points on
the plot are scattered without forming a clear pattern or trend.
EXISTING SYSTEM:
Ensure that your data is in the correct format. Since scatter graphs are meant to show how two numeric
values are related to each other, they should both be displayed in two separate columns.
The first column will usually be plotted on the X-axis and the second column on the Y-axis. The
independent variable usually falls on the X-axis and the dependent variable on the Y-axis.
Highlight the columns containing both sets of variables. If the columns are non-contiguous, hold down
the Ctrl key between selections. Only select the columns with the two sets of data that are being examined
for a cause/effect relationship.
From the Insert tab, go to the Charts group and click the Scatter graph symbol.
Several types of scatter plots are available from the Insert Charts menu. These include:
In Excel, a scatter chart displays data points positioned at coordinates located on an x-axis and y-axis.
Scatter charts are sometimes called X and Y charts, scatter plots, scatter diagrams, or scatter graphs.
A scatter chart helps you compare pairs of values and understand the relationship between two variables.
To create a scatter plot in Excel on laptop or desktop systems, follow these steps.
Check your data set to make sure you have at least two columns (or rows) of data. Ideally, the first cell in
each sequence will contain a text entry that describes the numbers that follow, such as “Mileage of Car” or
“Annual Maintenance Expense”.
With your mouse, select the cell in the upper left of the data you want to chart, then drag the cursor to the
lower right cell of the data set to select it.
Select Insert.
In Charts, select the Scatter (X, Y) or Bubble Chart dropdown.
Select More Scatter Charts at the bottom of the menu.
Select the Scatter chart option you prefer. (Scatter, Scatter with Smooth Lines and Markers, Scatter with
Smooth Lines, Scatter with Straight Lines and Markers, Scatter with Straight Lines, Bubble, or 3-D
Bubble)
Select whether you want to compare the two columns of data, or use the two columns as x- and y-axis
indicators, respectively. Select the chart style, then select OK.
Excel should now have inserted a chart into your spreadsheet that displays your data. If your chart title,
axis labels, and other chart elements meet your needs, you may stop at this point. However, in most cases,
you’ll need to adjust one or more chart elements.
Click (or tap) on blank space in the chart to select the chart.
Next, adjust chart element display options. Select the + key next to the chart to choose which chart
elements display. Next to each element, if you select the checkbox, the item will display. Deselect the
checkbox to hide an element.
The chart elements may include Axes, Axis Titles, Chart Title, Data Labels, Error Bars, Gridlines,
Legend, and Trendline. Select to the right of an element name to see a triangle that allows access to
additional element options. For example, next to Gridlines, you may enable Primary Major Horizontal,
Primary Major Vertical, Primary Minor Horizontal, Primary Minor Vertical, or More Options.
PROJECT DESCRIPTION:
With the source data correctly organized, making a scatter plot in Excel takes these two quick steps:
Select two columns with numeric data, including the column headers. In our case, it is the range
C1:D13. Do not select any other columns to avoid confusing Excel.
Go to the Inset tab > Chats group, click the Scatter chart icon, and select the desired template. To
insert a classic scatter graph, click the first thumbnail:
Besides the classic scatter plot shown in the above example, a few more templates are available:
The Excel XY plot templates can also draw each variable separately, presenting the same relationships in
a different way. For this, you should select 3 columns with data - the leftmost column with text values
(labels), and the two columns with numbers.
In our example, the blue dots represent advertising cost, and orange dots represent the items sold:
To view all available scatter types in one place, select your data, click the Scatter (X, Y) icon on the
ribbon, and then click More Scatter Charts… This will open the Inset Chart dialog box with the XY
(Scatter) type selected, and you switch between the different templates at the top to see which one
provides the best graphic representation of your data:
MODULES:
1.
import xlsxwriter
workbook = xlsxwriter.Workbook('chart_scatter.xlsx')
worksheet = workbook.add_worksheet()
data = [
[2, 3, 4, 5, 6, 7],
worksheet.write_column('B2', data[1])
worksheet.write_column('C2', data[2])
chart1.add_series({
})
# Configure a second series.
chart1.add_series({
})
chart1.set_style(11)
# is anchored to cell E2 .
worksheet.insert_chart('E2', chart1)
workbook.close()
2.
import xlsxwriter
workbook = xlsxwriter.Workbook('chart_scatter2.xlsx')
worksheet = workbook.add_worksheet()
data = [
[2, 3, 4, 5, 6, 7],
worksheet.write_column('A2', data[0])
worksheet.write_column('B2', data[1])
worksheet.write_column('C2', data[2])
chart1.add_series({
})
chart1.add_series({
})
chart1.set_style(11)
# is anchored to cell E2 .
worksheet.insert_chart('E2', chart1)
workbook.close()
MODULES SCREENSHOTS:
CONCLUSION:
A scatter plot can also be useful for identifying other patterns in data. We can divide data points into
groups based on how closely sets of points cluster together. Scatter plots can also show if there are any
unexpected gaps in the data and if there are any outlier points. This can be useful if we want to segment
the data into different parts, like in the development of user personas.
A scatterplot is one of the most powerful yet simple visual plots available. In a scatterplot, the data points
are marked in Cartesian space with attributes of the dataset aligned with the coordinates. The attributes
are usually of continuous data type. One of the key observations that can be concluded from a scatterplot
is the existence of a relationship between two attributes under inquiry. If the attributes are linearly
correlated, then the data points align closer to an imaginary straight line; if they are not correlated, the
data points are scattered. Apart from basic correlation, scatterplots can also indicate the existence of
patterns or groups of clusters in the data and identify outliers in the data. This is particularly useful for
low-dimensional datasets.
REFERENCES:
https://www.google.com/url?
sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwiKnY3x9deEAxUMcGwG
HXcoAQAQFnoECBYQAw&url=https%3A%2F%2F2.zoppoz.workers.dev%3A443%2Fhttps%2Fwww.ablebits.com%2Foffice-addins-blog
%2Fmake-scatter-plot-excel%2F&usg=AOvVaw03iQW7NT9DHWgRauAcrL6u&opi=89978449
https://www.google.com/url?
sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwiKnY3x9deEAxUMcGwG
HXcoAQAQFnoECCwQAQ&url=https%3A%2F%2F2.zoppoz.workers.dev%3A443%2Fhttps%2Ftrumpexcel.com%2Fscatter-plot-excel
%2F&usg=AOvVaw29gCB-FgfYNszG4RNxScUJ&opi=89978449
https://www.geeksforgeeks.org/python-plotting-scatter-charts-in-excel-sheet-using-xlsxwriter-module/