0

I want to draw graphs with Gnuplot. But when I click the button for the example plot sin (x), the gnuplot command window does not appear. I don't know the cause of that behavior

Braiam
  • 67,791
  • 32
  • 179
  • 269
  • 2
    What "button for the example plot" exactly? Are you using some kind of GUI wrapper program for gnuplot? If so, what is it? – steeldriver May 19 '14 at 13:30

2 Answers2

3

gnuplot is a command-line program; you have to run it in a terminal emulator. On Ubuntu the keyboard shortcut CTRL+ALT+t is set to open a new terminal window by default, but you can of course also find the terminal emulator in the Dash (or main menu).

In the terminal window, you can simply type gnuplot to launch the gnuplot command prompt. In order to plot your example, sin(x), on the gnuplot prompt, you can simply type:

plot sin(x) 

to obtain:

screenshot showing the usage of gnuplot

There is a great tutorial in the Gnuplotting page...

soulsource
  • 4,944
Rmano
  • 31,947
2

I assume your problem might be not able to plot using Gnuplot after installing. Because I too was unable to plot after installing it initially.

then from here gnuplot not showing the graph window I found solution that I need to install gnuplot-x11

so install it by running this command in terminal and see

sudo apt-get install gnuplot-x11

after that run

  gnuplot

then on the gnuplot prompt you can run

  plot sin(x)

and see graph

Bibi424
  • 618
  • 6
  • 13