Skip to content

Commit

Permalink
Tweak plot output appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian committed Jul 29, 2024
1 parent e63959e commit b670902
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gui/src/app/Scripting/pyodide/pyodideWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ patch_matplotlib(_SP_ADD_IMAGE)

postamble += `
import matplotlib.pyplot as plt
plt.show()
if len(plt.gcf().get_children()) > 1:
plt.show()
`;
}

Expand Down
3 changes: 1 addition & 2 deletions gui/src/app/Scripting/webR/runR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ const captureOutputOptions = {
captureStreams: true,
captureConditions: false,
captureGraphics: {
width: 340,
height: 340,
bg: "white", // default: transparent
pointsize: 12,
capture: true,
Expand Down Expand Up @@ -103,6 +101,7 @@ invisible(.SP_DATA)`;
// Set canvas size to image
canvas.width = img.width;
canvas.height = img.height;
canvas.style.width = "100%";

// Draw image onto Canvas
const ctx = canvas.getContext("2d");
Expand Down

0 comments on commit b670902

Please sign in to comment.