0

I have a 3D surf plot, where I plot a scatter cloud. You are then supposed to be able to see whether the scatter cloud is inside or outside the surface envelope. However, it's as if the scatter cloud is printed outside the surface plot depending on which angle I'm looking at?

As I've tried to show on the figure below, the red dots are my scatter plots and even though I know they are inside the blue surface "barrel" I can see them through the surface plot. If I then rotate the picture a little bit, it shows as it's supposed to.

Wrong and correct

My plotting sequence looks like this:

fig = plt.figure()
    ax = fig.gca(projection='3d') 
    for ii in range(0,numspan):
        for j in range(0,numpoints+1):
            for i in range(0,4):
                Nx[i,j,ii] = MMN_Diagram[Myplt[i]+j,Mzplt[i]+ii*3]
                My[i,j,ii] = MMN_Diagram[Myplt[i]+j,Mzplt[i]+ii*3+1]*scale
                Mz[i,j,ii] = MMN_Diagram[Myplt[i]+j,Mzplt[i]+ii*3+2]*scale
        surf = ax.plot_surface(My[:,:,ii], Mz[:,:,ii], Nx[:,:,ii], color='blue', rstride=1, cstride=1, linewidth=0.25, antialiased=True)

    plt.ylabel('MY [kNm]')
    plt.xlabel('MZ [kNm]')

    ax.plot([-10000,10000],[0,0],[0,0], color='black', linewidth=1.5) # X-axis
    ax.plot([0,0],[-10000,10000],[0,0], color='black', linewidth=1.5) # Y-axis
    ax.plot([0,0],[0,0],[-10000,10000], color='black', linewidth=1.5) # Z-axis

    ax.scatter(xl.iloc[:,2], xl.iloc[:,1], xl.iloc[:,0], color='red', s=1)

    plt.show(fig)
Martin
  • 353
  • 1
  • 6
  • 23

0 Answers0