Ubuntu 9.10 X11 linking and on-screen plotting
I use Ubuntu 9.10, and have a problem linking PGPLOT to X11 to view the output of some plottings on-screen.
I already had libx11-dev and PGPLOT installed, and found the path to libx11.so and libpgplot.so at /usr/lib.
I successfully link to this library as
f77 -o simple_ehsan simple.f -L /usr/lib -lpgplot -L /usr/lib -lX11
But, when running the code called simple_ehsan which calls pgplot, I receive the following error message:
Graphics device/type (? to see list, default /xwin): /xwin
PGPLOT /xw: cannot connect to X server 
I also receive the same complaint when trying to run /usr/bin/xclock:
Error: Can't open display: 0
I cannot figure out with the on-screen display problem I have. I also have to mention that I'm an Ubuntu newbie.