Doğrusal Grafikler
- Doğrusal
- Eğim
- Tutmak
Doğrusal
Lineer , düz demektir. Doğrusal bir grafik düz bir çizgidir.
Genel olarak, doğrusal bir grafik fonksiyon değerlerini gösterir.
Örnek
var xValues = [];
var yValues = [];
// Generate values
for (var x = 0; x <= 10; x += 1) {
xValues.push(x);
yValues.push(x);
}
// Display using Plotly
var data = [{
x: xValues,
y: yValues,
mode: "lines"
}];
// Define Layout
var layout = {title: "y = x"};
// Display using Plotly
Plotly.newPlot("myPlot", data, layout);
Eğim
Eğim , grafiğin açısıdır.
Eğim, doğrusal bir grafikteki bir değerdir:
y = bir x
Bu örnekte, eğim = 1.2 :
Örnek
var slope = 1.2;
var xValues = [];
var yValues = [];
// Generate values
for (var x = 0; x <= 10; x += 1) {
xValues.push(x);
yValues.push(x * slope);
}
// Define Data
var data = [{
x: xValues,
y: yValues,
mode: "lines"
}];
// Define Layout
var layout = {title: "Slope=" + slope};
// Display using Plotly
Plotly.newPlot("myPlot", data, layout);
Tutmak
Intercept , grafiğin başlangıç değeridir.
Kesişme, doğrusal bir grafikteki b değeridir:
y = balta + b
Bu örnekte, eğim = 1.2 ve kesişme noktası = 2 :
Örnek
var slope = 1.2;
var intercept = 7;
var xValues = [];
var yValues = [];
// Generate values
for (var x = 0; x <= 10; x += 1) {
xValues.push(x);
yValues.push(x * slope + intercept);
}
// Define Data
var data = [{
x: xValues,
y: yValues,
mode: "lines"
}];
// Define Layout
var layout = {title: "Slope=" + slope + " Intercept=" + intercept};
// Display using Plotly
Plotly.newPlot("myPlot", data, layout);