First off, I'm total novice at this.

I have a graph like :


And I want to rotate this plotted graph along the x-axis to get something like:


So Is there a way/online tool /piece of code to do this kind of operation(rotation along any axis) in TeXStudio using Tikz-PGF, LaTex or do I have to write complete code for the output myself? Please suggest.

PS: I have to work with both 2D/3D graphs.

1 Answer 1


Run with pdflatex --shell-escape <file>

%\usepackage[pspdf={-dALLOWPSTRANSPARENCY}]{pstricks-pdf}% GhostScript 9.53
\usepackage[pspdf={-dNOSAFER}]{pstricks-pdf}%  < 9.53

    fillcolor=yellow!40,opacity=0.4](0.5,2){12}{x sqrt 2 mul} 


enter image description here

  • As I said, I'm total novice at this. So can you please do me the favour of explaining this pdflatex command? Commented Jun 20, 2020 at 5:46
  • @JustCurious: You don't know how to use pdflatex from within TeXStudio? Commented Jun 21, 2020 at 13:49
  • Package pst-pdf Warning: File `pdf-pics.pdf' not found. is the error I get after running it from shell. What should I do next? @MoneyOrientedProgrammer Commented Jun 22, 2020 at 4:10
  • 1
    @JustCurious: Remove the first two \usepackage in the code above and leave the last one which is \usepackage{pst-func}. Now compilet the file with xelatex filename.tex. It takes several seconds to finish. If you want to save time, invoke the following latex filename.tex, dvips filename.dvi and ps2pdf filename.ps in the order I wrote. Commented Jun 22, 2020 at 5:31
  • @JustCurious: latex.userpage.fu-berlin.de/TeXstudio-Konfiguration.pdf shows the configuration of TeXStudio (see page 11 for inserting the --shell-escape option).
    – user187802
    Commented Jun 22, 2020 at 6:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .