Plotting 2D function of two variables
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have:
g(x, y) = x * (y + 3) - 5
I want a 2D plot of the "points" where x and y are 1, 2, 3 .. 10 .
How to do this? I could only find 3d plotting.
plotting
New contributor
add a comment |Â
up vote
1
down vote
favorite
I have:
g(x, y) = x * (y + 3) - 5
I want a 2D plot of the "points" where x and y are 1, 2, 3 .. 10 .
How to do this? I could only find 3d plotting.
plotting
New contributor
I don't understand what you are trying to plot. If x is 1 and y is 1, tehn g[1,1)=-1. What exactly do you want to plot?
â bill s
3 hours ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have:
g(x, y) = x * (y + 3) - 5
I want a 2D plot of the "points" where x and y are 1, 2, 3 .. 10 .
How to do this? I could only find 3d plotting.
plotting
New contributor
I have:
g(x, y) = x * (y + 3) - 5
I want a 2D plot of the "points" where x and y are 1, 2, 3 .. 10 .
How to do this? I could only find 3d plotting.
plotting
plotting
New contributor
New contributor
New contributor
asked 3 hours ago
Afonso Matos
1084
1084
New contributor
New contributor
I don't understand what you are trying to plot. If x is 1 and y is 1, tehn g[1,1)=-1. What exactly do you want to plot?
â bill s
3 hours ago
add a comment |Â
I don't understand what you are trying to plot. If x is 1 and y is 1, tehn g[1,1)=-1. What exactly do you want to plot?
â bill s
3 hours ago
I don't understand what you are trying to plot. If x is 1 and y is 1, tehn g[1,1)=-1. What exactly do you want to plot?
â bill s
3 hours ago
I don't understand what you are trying to plot. If x is 1 and y is 1, tehn g[1,1)=-1. What exactly do you want to plot?
â bill s
3 hours ago
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
3
down vote
accepted
g[x_, y_] := x*(y + 3) - 5
MatrixPlot[Array[g, 10, 10], PlotLegends -> Automatic, DataReversed -> True]
Beautiful, just as I was searching for. Thank you!
â Afonso Matos
2 hours ago
add a comment |Â
up vote
1
down vote
A simple 2D plot
g[x_, y_] := x*(y + 3) - 5
tp = Table[
Plot[g[x, y], x, 1, 10, PlotRange -> -5, 120,
PlotLabel -> "y", y, AxesLabel -> "x", "g[x,y]"], y, 1, 10];
gifs = ListAnimate[tp]
Alternatively you could plot g
vs y
and then vary x
.
add a comment |Â
up vote
0
down vote
DiscretePlot3D[x (y + 3) - 5,
x, 0, 10,
y, 0, 10]
add a comment |Â
up vote
0
down vote
g[x_, y_] := x*(y + 3) - 5
You could use either ContourPlot
ContourPlot[
g[x, y], x, 1, 10, y, 1, 10, Contours -> Range[0, 120, 5],
ContourLabels -> All,
PlotLegends -> Automatic,
ColorFunction -> "Rainbow"]
or DensityPlot
DensityPlot[
g[x, y], x, 1, 10, y, 1, 10,
PlotLegends -> Automatic,
ColorFunction -> "Rainbow"]
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
g[x_, y_] := x*(y + 3) - 5
MatrixPlot[Array[g, 10, 10], PlotLegends -> Automatic, DataReversed -> True]
Beautiful, just as I was searching for. Thank you!
â Afonso Matos
2 hours ago
add a comment |Â
up vote
3
down vote
accepted
g[x_, y_] := x*(y + 3) - 5
MatrixPlot[Array[g, 10, 10], PlotLegends -> Automatic, DataReversed -> True]
Beautiful, just as I was searching for. Thank you!
â Afonso Matos
2 hours ago
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
g[x_, y_] := x*(y + 3) - 5
MatrixPlot[Array[g, 10, 10], PlotLegends -> Automatic, DataReversed -> True]
g[x_, y_] := x*(y + 3) - 5
MatrixPlot[Array[g, 10, 10], PlotLegends -> Automatic, DataReversed -> True]
answered 3 hours ago
kglr
169k8193396
169k8193396
Beautiful, just as I was searching for. Thank you!
â Afonso Matos
2 hours ago
add a comment |Â
Beautiful, just as I was searching for. Thank you!
â Afonso Matos
2 hours ago
Beautiful, just as I was searching for. Thank you!
â Afonso Matos
2 hours ago
Beautiful, just as I was searching for. Thank you!
â Afonso Matos
2 hours ago
add a comment |Â
up vote
1
down vote
A simple 2D plot
g[x_, y_] := x*(y + 3) - 5
tp = Table[
Plot[g[x, y], x, 1, 10, PlotRange -> -5, 120,
PlotLabel -> "y", y, AxesLabel -> "x", "g[x,y]"], y, 1, 10];
gifs = ListAnimate[tp]
Alternatively you could plot g
vs y
and then vary x
.
add a comment |Â
up vote
1
down vote
A simple 2D plot
g[x_, y_] := x*(y + 3) - 5
tp = Table[
Plot[g[x, y], x, 1, 10, PlotRange -> -5, 120,
PlotLabel -> "y", y, AxesLabel -> "x", "g[x,y]"], y, 1, 10];
gifs = ListAnimate[tp]
Alternatively you could plot g
vs y
and then vary x
.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
A simple 2D plot
g[x_, y_] := x*(y + 3) - 5
tp = Table[
Plot[g[x, y], x, 1, 10, PlotRange -> -5, 120,
PlotLabel -> "y", y, AxesLabel -> "x", "g[x,y]"], y, 1, 10];
gifs = ListAnimate[tp]
Alternatively you could plot g
vs y
and then vary x
.
A simple 2D plot
g[x_, y_] := x*(y + 3) - 5
tp = Table[
Plot[g[x, y], x, 1, 10, PlotRange -> -5, 120,
PlotLabel -> "y", y, AxesLabel -> "x", "g[x,y]"], y, 1, 10];
gifs = ListAnimate[tp]
Alternatively you could plot g
vs y
and then vary x
.
answered 2 hours ago
Bill Watts
2,2081514
2,2081514
add a comment |Â
add a comment |Â
up vote
0
down vote
DiscretePlot3D[x (y + 3) - 5,
x, 0, 10,
y, 0, 10]
add a comment |Â
up vote
0
down vote
DiscretePlot3D[x (y + 3) - 5,
x, 0, 10,
y, 0, 10]
add a comment |Â
up vote
0
down vote
up vote
0
down vote
DiscretePlot3D[x (y + 3) - 5,
x, 0, 10,
y, 0, 10]
DiscretePlot3D[x (y + 3) - 5,
x, 0, 10,
y, 0, 10]
answered 3 hours ago
David G. Stork
22k21747
22k21747
add a comment |Â
add a comment |Â
up vote
0
down vote
g[x_, y_] := x*(y + 3) - 5
You could use either ContourPlot
ContourPlot[
g[x, y], x, 1, 10, y, 1, 10, Contours -> Range[0, 120, 5],
ContourLabels -> All,
PlotLegends -> Automatic,
ColorFunction -> "Rainbow"]
or DensityPlot
DensityPlot[
g[x, y], x, 1, 10, y, 1, 10,
PlotLegends -> Automatic,
ColorFunction -> "Rainbow"]
add a comment |Â
up vote
0
down vote
g[x_, y_] := x*(y + 3) - 5
You could use either ContourPlot
ContourPlot[
g[x, y], x, 1, 10, y, 1, 10, Contours -> Range[0, 120, 5],
ContourLabels -> All,
PlotLegends -> Automatic,
ColorFunction -> "Rainbow"]
or DensityPlot
DensityPlot[
g[x, y], x, 1, 10, y, 1, 10,
PlotLegends -> Automatic,
ColorFunction -> "Rainbow"]
add a comment |Â
up vote
0
down vote
up vote
0
down vote
g[x_, y_] := x*(y + 3) - 5
You could use either ContourPlot
ContourPlot[
g[x, y], x, 1, 10, y, 1, 10, Contours -> Range[0, 120, 5],
ContourLabels -> All,
PlotLegends -> Automatic,
ColorFunction -> "Rainbow"]
or DensityPlot
DensityPlot[
g[x, y], x, 1, 10, y, 1, 10,
PlotLegends -> Automatic,
ColorFunction -> "Rainbow"]
g[x_, y_] := x*(y + 3) - 5
You could use either ContourPlot
ContourPlot[
g[x, y], x, 1, 10, y, 1, 10, Contours -> Range[0, 120, 5],
ContourLabels -> All,
PlotLegends -> Automatic,
ColorFunction -> "Rainbow"]
or DensityPlot
DensityPlot[
g[x, y], x, 1, 10, y, 1, 10,
PlotLegends -> Automatic,
ColorFunction -> "Rainbow"]
answered 43 mins ago
Bob Hanlon
56.7k23591
56.7k23591
add a comment |Â
add a comment |Â
Afonso Matos is a new contributor. Be nice, and check out our Code of Conduct.
Afonso Matos is a new contributor. Be nice, and check out our Code of Conduct.
Afonso Matos is a new contributor. Be nice, and check out our Code of Conduct.
Afonso Matos is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f185481%2fplotting-2d-function-of-two-variables%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I don't understand what you are trying to plot. If x is 1 and y is 1, tehn g[1,1)=-1. What exactly do you want to plot?
â bill s
3 hours ago