Added ability to resize the plot to a given size.

Extended the resize function to take width and height arguments.

In this case it allows us to use CSS transition effects on resizing.