# flipping a graph to plot upside down

Because in my special application positive values on my y-axis increase downwards instead of upwards.

So while normally you would do this:

x,y = var('x,y')
f(x,y) = x^2 + y^2
contour_plot(f, (x,0,1), (y,0,1)).show()


(where y plots from smaller numbers to bigger ones) I instead want to do this:

x,y = var('x,y')
f(x,y) = x^2 + y^2
contour_plot(f, (x,0,1), (y,1,0)).show()


where I expect the same picture, just flipped upside down. Except, this bombs! How can i get my desired result? the axis should be properly labeled, too.

edit retag close merge delete

For reference, a similar question was asked again one month later:

( 2019-06-06 15:23:09 -0600 )edit

Sort by ยป oldest newest most voted

This works for me:

x,y = var('x,y')
f(x,y) = x^2 + y^2
P = contour_plot(f, (x,0,1), (y,0,1))
P.set_axes_range(0, 1, 1, 0)
P.show()


So does this:

x,y = var('x,y')
f(x,y) = x^2 + y^2
P = contour_plot(f, (x,0,1), (y,0,1))
P.ymin(1)
P.ymax(0)
P.show()

more