gnuplot warning: "plotting with an unknown terminal"

I'm trying to use gnuplot on my MacBook Air (Mac OS X 10.11.3). I have installed XQuartz by using homebrew after I installed gnuplot (with this YouTube video: https://www.youtube.com/watch?v=AR-GUSkqMCU). But gnuplot did not work and terminal showed: Terminal type is now 'unknown'. For example, I wanted to plot sin(x) and I got a error message as the following:

gnuplot> plot(sin(x)) WARNING: Plotting with an 'unknown' terminal. No output will be generated. Please select a terminal with 'set terminal'. 
204k 44 44 gold badges 361 361 silver badges 491 491 bronze badges asked Mar 30, 2018 at 8:55 11 1 1 silver badge 3 3 bronze badges

1 Answer 1

Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.

You need to install DirectX11 and XQuartz. Restart your Mac and Retry.