Ask Your Question

# 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

## Comments

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

( 2019-06-06 22:23:09 +0200 )edit

## 1 Answer

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

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2019-04-29 19:39:45 +0200

Seen: 332 times

Last updated: Apr 29 '19