How to change the location of all 3 axes on a 3D plot?

27 Views Asked by At

I am using JupyterLab to develop 3D plots. Starting out I am learning the basics of 3D plotting by plotting 3 unit vectors: x, y, and z. The default configuration is shown in Figure 1. I would like to change the location of x, y, and z axes to match the plot in Figure 2 and Figure 3.

MatPlotLib

I can use ax.view_init(elevation, azimuth) to change to change the view of the graph, but I would prefer not to do that.

I am failing to find a simple solution to this issue. How can I make this transformation?

1

There are 1 best solutions below

0
bla On

In Matlab, you just have to set view to the correct angle, in this case, view(135,35) , for example,

% Set the limits of the plot
axis equal;
xlim([0, 2]);     ylim([0, 2]);     zlim([0, 2]);

% Label the axes
xlabel('x');  ylabel('y');  zlabel('z');

view(135,35)

% Turn the grid on
grid on;

enter image description here