auto-optimization / eafpy

https://auto-optimization.github.io/eafpy/
Other
1 stars 0 forks source link

Create "stepped" 3d surface plot for plot_datasets function #5

Open FergusRooney opened 1 year ago

FergusRooney commented 1 year ago

It would be good to have a graph similar to what is described here to compare different 3 objective fronts for plot_datasets, however it seems like it will require some data manipulation and processing to work with the plotly go.mesh3d graph

MLopez-Ibanez commented 1 year ago

Yes, a graph like this would be great, but you have to be careful what the sides of the cubes separate. You could plot the region that is dominated as cubes and look at it from the region that is not dominated. Or you can plot the region that is NOT dominated as cubes and look at it from the region that is dominated. Both may be interesting (maybe one could switch from one to the other if the camera is inside/outside each region).

The third option is to just plot with a transparent color the sides of the cubes that are bounded by infinity, but I'm not sure how hard is to color each side with a different color.

MLopez-Ibanez commented 1 year ago

One possibility is to calculate the quads, that is, the rectangular faces that would draw the figure, then convert them to triangles and then plot them as a mesh3d:

triangles = []
for r in quads:
    triangles. extend([[r[0], r[1], r[2]], [r[0], r[2], r[3]]] # split each rectangle in two triangles
triangles = np.asarray(triangles)
I, J, K = triangles.T
x, y, z = verts.T
fig=go.Figure(go.Mesh3d(x=x, y=y, z=z, i=I, j=J, k=K, colorscale="matter_r", intensity=z))

This will likely look better than surface (because there will be no smoothing effect so the vertices will match the points) and be faster than cube (cube plots too many surfaces)