The government is closing the plug-in car grant scheme to new orders after supporting the sale of nearly half a million electric cars.