Ask Your Question

how to plot vertical lines

asked 2017-08-23 12:26:39 -0500

anonymous user


how do I plot a vertical line such as x = 3, together with another graph, such as y = x^3?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-08-23 15:38:04 -0500

fidbc gravatar image

If P and Q are plots then you may display them together via P+Q.

For the vertical line you may use implicit_plot or just draw it manually via line.

# plot line x=3
P = implicit_plot(x==3,(x,2,4),(y,-1,5))

# manualy draw line x=5
Q = line([(5,-1),(5,5)])

# display P and Q together.

Guess plotting y=x^3 can be left as an exercise ;-)


edit flag offensive delete link more

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


Asked: 2017-08-23 12:26:39 -0500

Seen: 48 times

Last updated: Aug 23