If you're using the proprietary Nvidia graphics driver in Ubuntu Linux, your system has the ability to rotate the video display. Why would you want to do this? Well, I have an HP w2207 wide screen monitor that can rotate into portrait mode. This can be handy for editing long documents or working with portrait images in the GIMP.
Enable Nvidia Screen Rotation
Now, for some reason, screen rotation is not enabled my default in Ubuntu's implementation of the Nvidia graphics drive, but that's easy enough to change. You just need to add one line to your xorg.conf file. First, we'll make a backup of the file.
sudo cp xorg.conf xorg.conf.bak
Now we'll edit the file.
Now find the Device section that includes the line:
Now add the line:
Option "RandRRotation" "on"
This is what my device section looks like after the edit (your file may have more lines in it).
Section "Device" Identifier "Default Device" Driver "nvidia" Option "NoLogo" "True" Option "RandRRotation" "on" EndSection
Now save the file, log out, and log back in (this is to restart the X server).
Rotate the screen with xrandr
Now that you have screen rotation enabled, you can rotate the screen with the xrandr command.
To rotate to the left, use:
To go back to normal, use:
To rotate right:
Or to flip the screen upside down:
GUI Configuration Tools
There are also some handy tools for the GUI if you prefer. There is a GNOME panel applet (Display Geometry Switcher) that you can install.
There is also grandr.
This will add an item to the menu under System→Administration→Multiple Screens.