It seems you are using
pdflatex to compile. Somehow,
pstricks is not friendly with
pdflatex. To compile documents that use
pstricks, you should use either
latex->dvips->ps2pdf. To do so, you should run
from the command prompt. If you have an editor (which one you are using?), it will certianly have a button for this.
Or you may use the same
pdflatex by adding
pdf option to
But for this you should have the latest version of
pstricks. The following code works for me with
pdflatex (though I get 2 badboxes).
If you need more help to know how to use
latex->dvips->ps2pdf routes, please let us know with some details like which editor and tex distribution you are using.
You can make
xelatex work with texmaker. First install a latest version of texmaker (make it a fresh install). Then pull the dropdown menu (by clicking the arrow tip next to pdflatex as in picture). Scroll down to get xelatex ans select it. Now you should get the button saying
xelatex instead of
Don't forget to remove
pdf option from
pstricks while using