# No 3D-view using pst-3d in pst-magneticfields

I'm quite green when it comes to pstricks and I have problems with a 3D-output using the package pst-magneticfields.

The sample code for 3D in the manual (page 12) is shown below (The preamble was not included so I added what I thought I required):

\documentclass{standalone}
\usepackage{pst-magneticfield}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\begin{document}

\psset{unit=0.7cm}
\newpsstyle{grille}{subgriddiv=0,gridcolor=blue!50,griddots=10}

\begin{pspicture}(-7,-6)(7,6)
\psmagneticfieldThreeD[N=8,R=2,L=8,pointsB=1200,linecolor=blue,pointsS=2000](-7,-6)(7,6)
\end{pspicture}

\end{document}


The output and how it was supposed to look is illustrated below:

What I get (above)

What I want (below)

The manual mentions the package "pst-3d" and an option "viewpoint", but adding it with or without the option has no effect. The log seems to mention that the package is already loaded.

I am compiling using xetex (which I am also unfamiliar with) using TeXstudio for mac.

• xelatex can not handle the 3d view. – user2478 Dec 18 '17 at 8:21

I have the same problem as you xelatex under MiKTeX.

HOWEVER: if you compile with pdflatex, loading the auto-pst-pdf package, and adding the -shell-escape switch to pdflatex, it works fine:

\documentclass{standalone}
\usepackage{pst-magneticfield}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\begin{document}

\psset{unit=0.7cm}
\newpsstyle{grille}{subgriddiv=0,gridcolor=blue!50,griddots=10}