This took some digging, but I can supply at least a partial answer.
Assuming you can copy the list of magnetic moments to a list, you could trick whatever software you are using for visualization into outputting it indirectly. A typical POSCAR can look like the following.
H
1.00000000000000
25 0 0
0 25 0
0 0 25
H
2
Selective dynamics
Cartesian
10 10 10 F F F
10 10 11 F F F
0 0 0
0 0 0
The last 2 sets of vectors represent a velocity and some? softwares will automatically view and let you plot velocities in the way that you want. Simply copying your magnetic moments to these will allow you to visualize it in anything you want (VMD, ASE, etc).
Added on 7/31/2020
Here is an implementation using ASE to visualize vectors.
from sys import argv
from ase.io import read
from ase.visualize import view
import numpy as np
file_in = argv[1]
text = open(file_in).readlines()
orbital = 4
if len(argv) > 3:
orbital = argv[2]
x, y, z = None, None, None
def process_mag(index):
return_array = []
while "--------" not in text[index]:
return_array.append(float(text[index].split()[orbital]))
index += 1
return return_array
for index in range(len(text)):
if " magnetization (x)" in text[index]:
index += 4
x = process_mag(index)
if " magnetization (y)" in text[index]:
index += 4
y = process_mag(index)
if " magnetization (z)" in text[index]:
index += 4
z = process_mag(index)
directions = zip(x, y, z)
for X, Y, Z in directions:
print("{} {} {}". format(X, Y, Z))
atoms = read(file_in)
atoms.set_velocities(np.array(directions)/10)
view(atoms)
This can be run with the OUTCAR as the first argument and optionally the magnetization orbital as the second (although it will default to total). Then by clicking "show velocities" under "view" menu, the vectors will be shown. The script will also print the X Y Z data for you to plot in another software.
It seems that most software packages ignore the POSCAR velocities, this is a somewhat annoying consequence of the file format being badly documented. Maybe there is another approach that someone can give since this is a bad visualization for publications.
