There's more...

You can add options to the command line to specify the resolution and also the color depth of the display. The higher the resolution and color depth (can be adjusted to use 8-bits to 32-bits per pixel to provide low or high color detail), the more data has to be transferred through the network link. If you find the refresh rate a little slow, try reducing these numbers as follows:

vncserver :1 -geometry 1280x780 -depth 24  

To allow the VNC server to start automatically when you switch on, you can add the vncserver command to .bash_profile (this is executed each time Raspberry Pi starts).

Use the nano editor as follows (the -c option allows the line numbers to be displayed):

sudo nano -c ~/.bash_profile  

Add the following line ...

Get Raspberry Pi 3 Cookbook for Python Programmers - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.