self._build()
// If no theme we use the default
self.theme = self.theme or theme_get()
try:
with mpl.rc_context():
// setup & rcparams theming
self.theme.apply_rcparams()
figure, axs = self._create_figure()
self._setup_parameters()
self._resize_panels()
// Drawing
self._draw_layers()
self._draw_facet_labels()
self._draw_labels()
self._draw_legend()
self._draw_title()
self._draw_watermarks()
// Artist object theming
self._apply_theme()
except Exception as err:
if self.figure is not None:
plt.close(self.figure)
raise err
if return_ggplot:
output = self.figure, self
else:
output = self.figure
After Change
// Pandas deprecated is_copy, and when we create new dataframes
// from slices we do not want complaints. We always uses the
// new frames knowing that they are separate from the original.
with pd.option_context("mode.chained_assignment", None):
return self._draw(return_ggplot)
def _draw(self, return_ggplot=False):
// Prevent against any modifications to the users
// ggplot object. Do the copy here as we may/may not
// assign a default theme