Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix in scalebar - removing the use of the minimumdescent argument in the call to TextArea #828

Merged

Conversation

christian-oreilly
Copy link
Contributor

Calls to sim.analysis.plotTraces(...) crashes with

Traceback (most recent call last):
  File "/Users/christian/opt/anaconda3/lib/python3.9/site-packages/netpyne/analysis/utils.py", line 87, in wrapper
    return function(*args, **kwargs)
  File "/Users/christian/opt/anaconda3/lib/python3.9/site-packages/netpyne/analysis/traces.py", line 400, in plotTraces
    plotFigPerTrace(cellGids)
  File "/Users/christian/opt/anaconda3/lib/python3.9/site-packages/netpyne/analysis/traces.py", line 317, in plotFigPerTrace
    addScaleBar()
  File "/Users/christian/opt/anaconda3/lib/python3.9/site-packages/netpyne/analysis/traces.py", line 200, in addScaleBar
    add_scalebar(
  File "/Users/christian/opt/anaconda3/lib/python3.9/site-packages/netpyne/support/scalebar.py", line 103, in add_scalebar
    sb = AnchoredScaleBar(ax.transData, **kwargs)
  File "/Users/christian/opt/anaconda3/lib/python3.9/site-packages/netpyne/support/scalebar.py", line 63, in __init__
    self.xlabel = TextArea(labelx, minimumdescent=False)
TypeError: __init__() got an unexpected keyword argument 'minimumdescent'

As per Matplotlib API changes for version 3.4.3::

minimumdescent parameter/property of TextArea

[offsetbox.TextArea](https://matplotlib.org/3.4.3/api/offsetbox_api.html#matplotlib.offsetbox.TextArea) 
has behaved as if minimumdescent was always True (regardless of the value to which it was set) since 
Matplotlib 1.3, so the parameter/property is deprecated.

This argument has been removed from the API of the current version of Matplotlib, causing this code to crash.

Removing the minimumdescent=False from the call to TextArea
@vvbragin vvbragin merged commit 2f88a1a into suny-downstate-medical-center:development Aug 30, 2024
@vvbragin
Copy link
Collaborator

Thanks @christian-oreilly! Merged

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