Message Boards Message Boards

0
|
8058 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Add a point to a 3D graph with a label?

Posted 4 years ago

I am trying to add a point on a 3D surface plot, and add a label without a line and a background. My code is as follows:

fig1 = Plot3D[Log[a] + Log[b], {a, 1, 10}, {b, 1, 10}];
fig2 = ListPointPlot3D[{{5, 5, Log[5] + Log[5]}} -> {"X"}]; 
Show[fig1, fig2]

Questions:

(1) Only half of the dot is showing above the surface plot. How can I have the entire dot appear? Should I simply add a small amount to the z-coordinate?

(2) How can I get rid of the line connecting the dot and the label?

(3) How can I get rid of the background of the label (make background transparent)?

Any help will be greatly appreciated.

Sincerely,

Cuneyt

POSTED BY: Cuneyt Eroglu
4 Replies
Posted 4 years ago

This makes perfect sense! Thank you, Rohit!

POSTED BY: Cuneyt Eroglu
Posted 4 years ago

Yes, there is a way, but it is counterintuitive, change 5, 5 to 5, -5.

f2 = Graphics3D[{Black, PointSize[0.02], 
         Point[{5, -5, Log[5] + Log[5] + .1}], 
         Text[Style["X", 12], {5, -5, Log[5] + Log[5] + .6}]}, Axes -> True]

enter image description here

POSTED BY: Rohit Namjoshi
Posted 4 years ago

Hi Rohit, Thanks for your reply. When I Graphics3D I cannot combine fig1 and fig2 because fig1 has a reverse axis. I use ScalingFunctions -> {None, "Reverse"} in fig1. So, the following code places X outside the surface plot.

fig1 = Plot3D[Log[a] + Log[b], {a, 1, 10}, {b, 1, 10}, 
  ScalingFunctions -> {None, "Reverse"}]; f2 = 
 Graphics3D[{Black, PointSize[0.02], 
   Point[{5, 5, Log[5] + Log[5] + .1}], 
   Text[Style["X", 12], {5, 5, Log[5] + Log[5] + .6}]}];
Show[fig1, f2]

Is there a way to make Graphics3D work with a reverse axis or is there a way to modify labels in ListPointPlot3D? Thank you so much in advance. Cuneyt

POSTED BY: Cuneyt Eroglu
Posted 4 years ago

Hi Cuneyt,

Yes, the easiest way is to add an offset. Rather than using ListPointPlot3D you could use Graphics3D so you have more control over the point and label.

f2 = Graphics3D[{Black, PointSize[0.02], 
         Point[{5, 5, Log[5] + Log[5] + .1}], 
         Text[Style["X", 12], {5, 5, Log[5] + Log[5] + .6}]}];

Show[fig1, f2]

enter image description here

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract