Ubuntu display
Changing display settings in Ubuntu.
Note that Ubuntu in most cases will automatically detect that you insert / remove a screen.
The Display method
Also known as nouveau
Search for display in Dash Home. More abaout Ubuntu_Dash_Home
In Displays you can among other things detect monitors connected to your computer, select the extended / clone mode, resolution, rotation and select the order in which the monitors should be in.
You can extend the desktop to span two monitors as well.
Cloning your desktop when you are connected to a projector.
When you press apply the settings are written to the file ~/.config/monitors.xml. The file can be edit manually with vi or another text editor.
xorg.conf method
If you have a nvidia graphick card or simular and you are not able to use nouveau, then you have other tools installed like NVIDIA X Server Settings.
Search for nvidia in Dash Home. More about Ubuntu_Dash_Home
The result will show you NVIDIA X Server Settings tool that gives you possibleities to detect monitors connected to your computer, select the extended / clone mode, resolution, rotation and the order the monitors should be in.