First time here? Check out the FAQ!

Ask Your Question
2

reverse y-axis graph

asked 5 years ago

Markio gravatar image

I'm sorry for asking trivial things, but I can't find this in the reference manual. I have produced a graph by plotting a function simply by putting a minus sign in front of the function. But I actually want to reverse the axis to get positive values in the downward direction. Is it possible to achieve this? (I am unable to post the graph, because my karma < 60)

w1_plot = plot(-w1_numerical, (x,0,3000), linestyle=":", gridlines=True, legend_label='$w_1$'
Preview: (hide)

Comments

This is similar to a previously asked question:

slelievre gravatar imageslelievre ( 5 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 5 years ago

Juanjo gravatar image

Add the keys ymin and ymax with suitable values. For example, compare the graphs given by

plot(x*sin(pi*x)^2, (x,0,2))

and

plot(x*sin(pi*x)^2, (x,0,2), ymin=2, ymax=0)
Preview: (hide)
link

Comments

Thank you!

Markio gravatar imageMarkio ( 5 years ago )

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 5 years ago

Seen: 976 times

Last updated: Jun 06 '19