1

this is the graph in question and the dots should appear in the bottom plane, not "above" the plane like i manged to. enter image description here

bx.scatter(xs,ys,zs, zdir=zs,c=plt.cm.jet(np.linspace(0,1,N))) # scatter points
for i in range(N-1):
    bx.plot(xs[i:i+2], ys[i:i+2], zs[i:i+2], color=plt.cm.jet(i/N), alpha=0.5) 
   #plots the lines between points
bx.scatter(xs,ys,zs=732371.0,zdir="z",c=plt.cm.jet(np.linspace(0,1,N)),depthshade=True)   
 bx.set_zlim3d(732371.0,) #limit is there so that we can project the points onto the xy-plane

as youll notice the points are drawn above the xy-grid and I had to set a lower limit for the z-axis so that the first projected point will not interfere with the first scatter point

I would prefer the points be in 2d and less hacky since I got 50 other graphs to do like this and fine tune each one would be cumbersome.

Got some simpler method you want to share?

Sirmione
  • 281
  • 2
  • 10
  • 1
    Why not just set the Z-coordinate to zero? – meowgoesthedog Jan 03 '18 at 14:25
  • because the z axis is in datetime format, if i'd put 0 it would mean "start z axis in 1970" and the graph would be impossible to read. thats why I used 732371.0 which is 2006-03-01, if I recall correctly – Sirmione Jan 03 '18 at 14:46

1 Answers1

1

There are many options, and ultimately, it depends on the range of your data in the other plots.

1) Offset the projection point by a fixed amount You could calculate the minimum Z value, and plot your projection a fixed offset from that minimum value.

zs=min(zs)-offset

2) offset the projection by a relative amount that depends on the range of your data. You could take into account the range of your data (i.e. the distance from min to max Z) and calculate an offset proportional to that (e.g. 10-15%).

zs=min(zs)-0.15*(max(zs)-min(zs))
Diziet Asahi
  • 38,379
  • 7
  • 60
  • 75