# Text on 3D graphics

**URL:** <https://scilab.discourse.group/t/text-on-3d-graphics/414>\
**Category:** General usage\
**Created:** [February 27, 2024, 6:56pm UTC](https://scilab.discourse.group/t/text-on-3d-graphics/414 "2024-02-27T18:56:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pblase](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@pblase](https://scilab.discourse.group/u/pblase)\
**Post date:** [February 27, 2024, 6:56pm UTC](https://scilab.discourse.group/t/text-on-3d-graphics/414/1 "2024-02-27T18:56:52Z")

</div>

How would I put text up in a 3D graphics window (plotted with scatter3d() )? The text functions, e.g. xnumb(), seem to only work with a 2D window.

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [February 27, 2024, 9:06pm UTC](https://scilab.discourse.group/t/text-on-3d-graphics/414/2 "2024-02-27T21:06:43Z")

</div>

Hello,

You are right, scilab is missing 3d aware text functions. To draw text in 3d, e.g. with xnumb, you have to do it this way:

```auto
x = rand(20,1);
y = rand(20,1);
z = rand(20,1);
scatter3d(x,y,z);
xnumb(x,y,1:20);
h = findobj(gce().parent,"type","Text");
h.data(:,3) = z($:-1:1)';

```

 ![Capture d’écran 2024-02-27 à 22.05.59](https://global.discourse-cdn.com/free1/uploads/utc/original/1X/e2717a8ad133bccb73cafe217c65109fa6f8cd01.jpeg)
