I want to create this graph in Texstudio. However, I have no clue about how to compile gnuplot using -shell-escape. If someone could help, I'd appreciate it.
You need to go to
Commands tab, and in the
PdfLaTeX option you will see
pdflatex -synctex=1 -interaction=nonstopmode %.tex
then, you need to add the options there, like
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex
Ok. And the next execution of
pdflatex should use that option.
You should see it in the log.