Skip to content

Commit ea7895d

Browse files
author
minjk-bl
committed
Add matplotlib inline
1 parent 42de5e1 commit ea7895d

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

js/m_apps/Import.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -245,17 +245,11 @@ define([
245245
}
246246
}
247247

248-
this.state.importMeta && this.state.importMeta.forEach(pack => {
249-
if (pack.i0 == pacI0) {
250-
// if include code exists?
251-
if (pack.include != undefined) {
252-
pack.include.forEach(code => {
253-
sbCode.appendLine();
254-
sbCode.append(code);
255-
});
256-
}
257-
}
258-
})
248+
// Need additional code?
249+
if (pacI0 == 'matplotlib.pyplot' || pacIO == 'matplotlib') {
250+
sbCode.appendLine();
251+
sbCode.append('%matplotlib inline');
252+
}
259253

260254
importMeta.push({ i0: pacI0, i1: pacI1, type: pacType, checked: pacChecked });
261255
}

js/m_visualize/Seaborn.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ define([
492492
var fontSize = $(this.wrapSelector('#fontSize')).val();
493493

494494
code.appendLine('import matplotlib.pyplot as plt');
495+
code.appendLine('%matplotlib inline');
495496
code.appendLine('import seaborn as sns');
496497
code.appendFormatLine("plt.rc('figure', figsize=({0}, {1}))", figWidth, figHeight);
497498
if (styleName && styleName.length > 0) {

0 commit comments

Comments
 (0)