Skip to content

Emit only valid Graphics options from Plot - #1553

Merged
bdlucas1 merged 2 commits into
Mathics3:masterfrom
bdlucas1:only-valid-graphics-options
Dec 23, 2025
Merged

bdlucas1 merged 2 commits into
Mathics3:masterfrom
bdlucas1:only-valid-graphics-options

Conversation

@bdlucas1

Copy link
Copy Markdown
Collaborator

Currently Plot passes all options on to the generated Graphics object. This makes the tests more fragile than necessary because these options, not being valid Graphics options, are no-ops, and this is a bit of an impediment to refactoring.

  • Only pass valid Graphics options on from Plot to the resulting Graphics
  • Add the (non-standard) LogPlot option that we use to make logarithmic axes to list of valid Graphics options

I verified through my end-to-end tests in that render all the doctests (and more) using m3d and compare the resulting image to an expected image that there are no changes in the generated images, confirming that the options that were being passed are no-ops.

* Only pass valid Graphics on from Plot to the resulting Graphics
* Add (non-standard) LogPlot to list of valid Graphics options
@rocky

rocky commented Dec 22, 2025

Copy link
Copy Markdown
Member

LGTM

@bdlucas1
bdlucas1 merged commit 0c46d96 into Mathics3:master Dec 23, 2025
17 checks passed
@bdlucas1 bdlucas1 mentioned this pull request Dec 23, 2025
bdlucas1 added a commit that referenced this pull request Dec 24, 2025
Issue #1554 

PR #1553 restricted options passed from Plot to Graphics to only include
valid Graphics options in order make the tests more robust. This
required adding LogPlot to the list of allowable Graphics options, with
a default of False. So now all Graphics objects have a LogPlot option,
most with a value of False, whereas previously only log plots generated
a LogPlot option in Graphics, with a value of True. However the SVG
generation code in builtin/box/graphics.py did not check the value of
the LogPlot option when deciding whether to generate log axes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants