Added support for nb backend when using matplotlib magic