Infinite axline in 3D

127 Views Asked by At

I am trying to draw a scene like in the picture below using Python matplotlib, but I got stuck on drawing the infinite line (the black & dotted one in the picture). In 2D, this line can be drawn using axline, but I couldn't find an alternative in 3D.

Is there any solution to this?

enter image description here

1

There are 1 best solutions below

1
On

ax.hline and ax.vline are parallel to the respective axis. as a workaround, you can use

ax.plot((x_0, x_1), (y_0, y_1), (z_0, z_1), color='k', linestyle='dashed')

with sufficiently far away points and appropriately scaled xyz-lims.