Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions mathics/builtin/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3226,14 +3226,15 @@ def boxes_to_xml(self, leaves=None, **options):
svg,
)

return (
'<mtext><img width="%dpx" height="%dpx" src="data:image/svg+xml;base64,%s"/></mtext>'
% (
# mglyph, which is what we have been using, is bad because MathML standard changed.
# metext does not work beacause the way in which we produce the svg images is also based on this outdated mglyph behaviour.
# format = "<mtext><img width="%dpx" height="%dpx" src="data:image/svg+xml;base64,%s"/></mtext>"
template = '<mglyph width="%dpx" height="%dpx" src="data:image/svg+xml;base64,%s"/>'
return template % (
int(width),
int(height),
base64.b64encode(svg_xml.encode("utf8")).decode("utf8"),
)
)

def axis_ticks(self, xmin, xmax):
def round_to_zero(value):
Expand Down