🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to AI Notes
Topic #7

ML Scatter Plots

  • Data Collections
  • Scatter Plots
  • Graphs

Data Collection

Collecting data is the most important part of any Machine Intelligence projects.

The most common data to collect are numbers and measurements.

Often data are stored in arrays representing the relationship between values.

This table contains house prices versus size:

Col 1 Col 2 Col 3 Col 4 Col 5 Col 6 Col 7 Col 8 Col 9 Col 10 Col 11 Col 12
Price 7 8 8 9 9 9 10 11 14 14 15
Size 50 60 70 80 90 100 110 120 130 140 150

Scatter Plots

A Scatter Plot has points scattered over an area representing the relationship between two values.

Example

const xArray = [50,60,70,80,90,100,110,120,130,140,150];
const yArray = [7,8,8,9,9,9,10,11,14,14,15];

// Define Data
const data = [{
  x: xArray,
  y: yArray,
  mode:"markers"
}];

// Define Layout
const layout = {
  xaxis: {range: [40, 160], title: "Square Meters"},
  yaxis: {range: [5, 16], title: "Price in Millions"},
  title: "House Prices vs. Size"
};

// Display with Plotly
Plotly.newPlot("myPlot", data, layout);

Graphs

A Graph can also be used to show the same values:

Col 1 Col 2 Col 3 Col 4 Col 5 Col 6 Col 7 Col 8 Col 9 Col 10 Col 11 Col 12
Price 7 8 8 9 9 9 10 11 14 14 15
Size 50 60 70 80 90 100 110 120 130 140 150

Source Code

const xArray = [50,60,70,80,90,100,110,120,130,140,150];
const yArray = [7,8,8,9,9,9,10,11,14,14,15];

// Define Data
const data = [{
  x: xArray,
  y:yArray,
  mode:"lines"
}];

// Define Layout
const layout = {
  xaxis: {range: [40, 160], title: "Square Meters"},
  yaxis: {range: [5, 16], title: "Price in Millions"},
  title: "House Prices vs Size"
};

// Display with Plotly
Plotly.newPlot("myPlot", data, layout);

When to Use Scatter Plots

Scatter plots are great for:

  • Seeing the "Big Picture"
  • Compare different values
  • Discovering potential trends
  • Discovering patterns in data
  • Discovering relationships between data
  • Discovering Clusters and Correlations

Want to go beyond the notes?

Join CodingNow 2.0's AI course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

ML Scatter Plots – FAQs

Quick answers about learning ML Scatter Plots in AI.

This free note from CodingNow 2.0 explains ML Scatter Plots in AI — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every AI topic on CodingNow 2.0, including ML Scatter Plots, is 100% free with no signup required.
With focused practice, most students grasp ML Scatter Plots in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now