Add customizable size to matplus #37
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates the
ScatterPlot
class inMatPlus/ScatterPlot.py
to add support for specifying plot height and made width do something, improving the flexibility and accuracy of plot sizing. The changes ensure that both plot width and height are configurable and correctly used throughout the plotting logic.Enhancements to plot sizing:
height
parameter to theScatterPlot
class docstring and constructor, allowing users to specify the plot's height. (MatPlus/ScatterPlot.py
) [1] [2]height
parameter as an instance variable in the class initializer. (MatPlus/ScatterPlot.py
)Updates to plotting logic:
plot
method to use bothwidth
andheight
for the figure size by passing them toplt.subplots(figsize=(self.width, self.height))
. (MatPlus/ScatterPlot.py
)plot
method to use bothwidth
andheight
, ensuring correct scaling for variable aspect ratios. (MatPlus/ScatterPlot.py
) [1] [2]Description by Korbit AI
What change is being made?
Add a new height parameter to ScatterPlot to customize the figure's vertical size and use it when creating the plot.
Why are these changes being made?
To give users control over the aspect ratio of scatter plots and ensure sizing logic accounts for the new height; an updated example notebook demonstrates using width and height together.