Assuming you have solved the inverse kinematics (IK) problem already...
I suppose you have a transformation matrix for each joint, build up from one line in the DH table (if you used DH to describe the robot).
Form the IK you have obtained
$Q = [q_1, q_2, q_3, q_4, q_5, q_6]$
Having all Q values you can now write:
$H_{0,1} = A_1(q_1)$
$\Rightarrow$ $H_{0,1}(1:3, 4)$ will give you the $x$, $y$ and $z$ Coordinates of joint 1
$H_{0,2} = H_{0,1}*A_2(q_2)$
$\Rightarrow$ $H_{0,2}(1:3, 4)$ will give you the $x$, $y$ and $z$ Coordinates of joint 2
$H_{0,3} = H_{0,2}*A_3(q_3)$
$\Rightarrow$ $H_{0,3}(1:3, 4)$ will give you the $x$, $y$ and $z$ Coordinates of joint 3
$H_{0,4} = H_{0,3}*A_4(q_4)$
$\Rightarrow$ $H_{0,4}(1:3, 4)$ will give you the $x$, $y$ and $z$ Coordinates of joint 4
$H_{0,5} = H_{0,4}*A_5(q_5)$
$\Rightarrow$ $H_{0,5}(1:3, 4)$ will give you the $x$, $y$ and $z$ Coordinates of joint 5
$H_{0,6} = H_{0,5}*A_6(q_6)$
$\Rightarrow$ $H_{0,6}(1:3, 4)$ will give you the $x$, $y$ and $z$ Coordinates of joint 6
$H_{0,tool} = H_{0,6}*A_{tool}$
where
- $A_i$ is the DH-transformation matrix associated with joint $i$.
- the index $_0$ represents the world frame
- the intex $_{tool}$ represents the tool frame
- $H_{i,j}$ represent the transformation matrix from frame $i$ to frame $j$