Peculiar horizontal lines in 3d plots

Viewed 114

I am trying to make a 3d plot as using 3 2d arrays. I get the plot just fine but I want to truncate the axes using ax.set_xlim()

This is the original plot I have: enter image description here

I want to remove the long tails for each curve. I use ax.set_xlim(0,30) and this is the result: enter image description here

I want to get rid of the extra part that is flowing out of the graph area. If I reduce the limits futher with ax.set_xlim(0,25), I get something even more weird:

enter image description here

Ideally, I would want the x-axis to only show points until 25. How can I get rid of the extra parts?

Thanks in advance!

The code (the arrays are being read from a file):

    fig = plt.figure()

    ax = plt.axes(projection = '3d')

    for i in range(5):
      ax.plot(E[:,i], freq[:,i], DF[:,i])

    ax.set_zlabel(filename + "$\ [eV^{-1} cm^{-3}]$")
    ax.set_xlabel("$\epsilon [eV]$")
    ax.set_ylabel("f [MHz]")
    ax.set_xlim(0,25)
    ax.set_yticks(freq[0])
    fig.savefig(filename+"3d.png", dpi = 1500, bbox_inches='tight')

Data file from where the data is being read: File

0 Answers
Related