Skip to content

Conversation

joy-kitson
Copy link

@joy-kitson joy-kitson commented Mar 24, 2025

  • Tried adjusting the line plot example to use log-log scale and encountered this error:
Traceback (most recent call last):
  File "/home/jkitson/work/epicast/pssg-plots/examples/simple-line-plot.py", line 15, in <module>
    simple_line.plot(data=df, x="nodes",
  File "/home/jkitson/work/epicast/pssg-plots/examples/../pssgplot/lineplot.py", line 71, in plot
    self.ax.set_xscale('log', basex=logx)
  File "/home/jkitson/.local/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 73, in wrapper
    return get_method(self)(*args, **kwargs)
  File "/home/jkitson/.local/lib/python3.10/site-packages/matplotlib/axis.py", line 837, in _set_axes_scale
    ax._axis_map[name]._set_scale(value, **kwargs)
  File "/home/jkitson/.local/lib/python3.10/site-packages/matplotlib/axis.py", line 796, in _set_scale
    self._scale = mscale.scale_factory(value, self, **kwargs)
  File "/home/jkitson/.local/lib/python3.10/site-packages/matplotlib/scale.py", line 717, in scale_factory
    return scale_cls(axis, **kwargs)
TypeError: LogScale.__init__() got an unexpected keyword argument 'basex'
  • Fixed this error by switching from using base{x,y} -> base when calling set_{x,y} scale to fix unexpected argument error

Suspect that this might come down to a versioning issue, but putting this PR here in case someone else ran into the same bug

@jhdavis8 jhdavis8 requested a review from Copilot March 25, 2025 16:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an unexpected argument error by replacing the deprecated basex/basey parameters with the updated base parameter for log scales, and it updates the grid line style for better visual consistency.

  • Replace basex with base and basey with base in x and y scale settings
  • Update grid linestyle from dashed to dotted in both lineplot and barplot

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pssgplot/barplot.py Updated x and y scale parameter names and grid linestyle
pssgplot/lineplot.py Updated x and y scale parameter names and grid linestyle

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.

1 participant