First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 10 years ago

Darwin gravatar image

plot 2d functions

This should be extremely easy, I want to make a nice colour plot of a 2d function where colour denotes the function value.

I can do

y=var('y')

f=y^2

plot(f)

and I get a nice plot.

If I try

y=var('y')

f=y^2+x^2

plot(f)

Then sage tells me it can't find the variable y. Which is ridiculous, since y is in the same place as when I tried to plot a 1d function of y. Anyway, I tried googling to find a function within sage to achieve this (without resorting to excessive matplotlib syntax) and had no success so thought I'd ask a question here. Intuitively the first case is hardly more complicated than the second case so there should be a simple function that can realize this for me.

Many thanks!

click to hide/show revision 2
No.2 Revision

plot Plotting a 2d functionsfunction

This should be extremely easy, I want to make a nice colour plot of a 2d function where colour denotes the function value.

I can do

y=var('y')

f=y^2

plot(f)

and I get a nice plot.

If I try

y=var('y')

f=y^2+x^2

plot(f)

Then sage tells me it can't find the variable y. Which is ridiculous, since y is in the same place as when I tried to plot a 1d function of y. Anyway, I tried googling to find a function within sage to achieve this (without resorting to excessive matplotlib syntax) and had no success so thought I'd ask a question here. Intuitively the first case is hardly more complicated than the second case so there should be a simple function that can realize this for me.

Many thanks!

click to hide/show revision 3
No.3 Revision

Plotting a 2d function

This should be extremely easy, I want to make a nice colour plot of a 2d function where colour denotes the function value.

I can do

y=var('y')

f=y^2

plot(f)

and I get a nice plot.

If I try

y=var('y')

f=y^2+x^2

plot(f)

Then sage tells me it can't find the variable y. Which is ridiculous, since y is in the same place as when I tried to plot a 1d function of y. Anyway, I tried googling to find a function within sage to achieve this (without resorting to excessive matplotlib syntax) and had no success so thought I'd ask a question here. Intuitively the first case is hardly more complicated than the second case so there should be a simple function that can realize this for me.

Many thanks!

click to hide/show revision 4
No.4 Revision

Plotting a 2d function

This should be easy, I want to make a nice colour plot of a 2d function where colour denotes the function value.

I can do

y=var('y')

f=y^2

plot(f)

and I get a nice plot.

If I try

y=var('y')

f=y^2+x^2

plot(f)

Then sage tells me it can't find the variable y. Which is ridiculous, since y is in the same place as when I tried to plot a 1d function of y. Anyway, I tried googling to find a function within sage to achieve this (without resorting to excessive matplotlib syntax) and had no success so thought I'd ask a question here. Intuitively the first Intuitively, the second case is hardly more complicated than the second case former so there should be a simple function that can realize this for me.

Many thanks!

click to hide/show revision 5
retagged

updated 10 years ago

FrédéricC gravatar image

Plotting a 2d function

This should be easy, I want to make a nice colour plot of a 2d function where colour denotes the function value.

I can do

y=var('y')

f=y^2

plot(f)

and I get a nice plot.

If I try

y=var('y')

f=y^2+x^2

plot(f)

Then sage tells me it can't find the variable y. Which is ridiculous, since y is in the same place as when I tried to plot a 1d function of y. Anyway, I tried googling to find a function within sage to achieve this (without resorting to excessive matplotlib syntax) and had no success so thought I'd ask a question here. Intuitively, the second case is hardly more complicated than the former so there should be a simple function that can realize this for me.

Many thanks!