8
$\begingroup$

What is the best way to draw a path (red color, dashed) along the surface of the smoothHistogram3D. Assume the paths desired to be the X=0 and Y=0 Axes.

data = {{0.798333, 1.21167}, {-0.415, 0.915}, {-0.675, 0.715}, {0.785, 
0.675}, {-0.55, 0.645}, {-0.125, 0.57}, {0.15, 0.27}, {-0.3, 
0.115}, {0.925, -0.685}, {0.748333, 1.27167}, {-0.465,
0.975}, {-0.725, 0.775}, {0.735, 0.735}, {-0.6, 0.705}, {-0.175, 
0.63}, {0.1, 0.33}, {-0.35, 0.175}, {0.875, -0.625}, {0.628333, 
1.18167}, {-0.585, 0.885}, {-0.845, 0.685}, {0.615, 0.645}, {-0.72,  
0.615}, {-0.295, 0.54}, {-0.02, 0.24}, {-0.47, 
0.085}, {0.755, -0.715}, {0.718333, 1.23167}, {-0.495, 
0.935}, {-0.755, 0.735}, {0.705, 0.695}, {-0.63, 0.665}, {-0.205,
0.59}, {0.07, 0.29}, {-0.38, 0.135}, {0.845, -0.665}, {0.738333, 
1.23167}, {-0.475, 0.935}, {-0.735, 0.735}, {0.725, 0.695}, {-0.61, 
0.665}, {-0.185, 0.59}, {0.09, 0.29}, {-0.36, 
0.135}, {0.865, -0.665}, {1.07833, 1.43167}, {-0.135, 
1.135}, {-0.395, 0.935}, {1.065, 0.895}, {-0.27, 0.865}, {0.155, 
0.79}, {0.43, 0.49}, {-0.02, 0.335}, {1.205, -0.465}};
SmoothHistogram3D[data]

enter image description here

$\endgroup$
9
$\begingroup$

You could use a Mesh.

plot = SmoothHistogram3D[data];
path = SmoothHistogram3D[data,
  MeshFunctions -> {#1 &, #2 &},
  Mesh -> {{0}, {0}}, MeshStyle -> Directive[Thick, Red],
  PlotStyle -> None, BoundaryStyle -> None];
Show[{plot, path}]

enter image description here

$\endgroup$
9
$\begingroup$

Like that?

SmoothHistogram3D[data, MeshFunctions -> {#1 &, #2 &}, Mesh -> 1, 
  MeshStyle -> Directive[Red, Dashed]]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.