Gnuplot with xterm in yosemite [duplicate]

I installed gnuplot on my yosemite system using brew. When I try to plot cos(x) the way I would on ubuntu, I get this:

gnuplot> plot cos(x)
WARNING: Plotting with an 'unknown' terminal.
No output will be generated. Please select a terminal with 'set terminal'.

I also notice that when gnuplot loads, it says Terminal type set to 'unknown'. I would like to load the graphs in a new window, so I tried set terminal xterm, which seems to work at first glance, given the message Terminal type set to 'xterm'. But then I try plotting again, and it produces garbage:

enter image description here

How do I get the terminal to function correctly, as it does on ubuntu?


Solution 1:

Don't know if you resolved, but seems strange to me you want to plot in the xterm terminal... Perhaps you want to display in the x11 terminal, you'll then find this discussion useful: Can't plot with gnuplot on my Mac