Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receiving "TypeError: __init__() got an unexpected keyword argument 'basey'" In this tutorial

I've been trying to run through this tutorial (https://bedapub.github.io/besca/tutorials/scRNAseq_tutorial.html) for the past day and constantly get an error after running this portion:

bc.pl.kp_genes(adata, min_genes=min_genes, ax = ax1)

The error is the following:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/miniconda3/lib/python3.9/site-packages/besca/pl/_filter_threshold_plots.py", line 57, in kp_genes
    ax.set_yscale("log", basey=10)
  File "/opt/miniconda3/lib/python3.9/site-packages/matplotlib/axes/_base.py", line 4108, in set_yscale
    ax.yaxis._set_scale(value, **kwargs)
  File "/opt/miniconda3/lib/python3.9/site-packages/matplotlib/axis.py", line 761, in _set_scale
    self._scale = mscale.scale_factory(value, self, **kwargs)
  File "/opt/miniconda3/lib/python3.9/site-packages/matplotlib/scale.py", line 597, in scale_factory
    return scale_cls(axis, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'basey'

Anyone have any thoughts? I've uninstalled and installed matplotlib to make sure its updated but that doesn't seem to have done anything either.

Would appreciate any help! And thank you in advance I'm a beginner!

like image 458
SorenFlying Avatar asked Oct 14 '25 19:10

SorenFlying


1 Answers

I had a similar problem when I tried to scale the y-axis of my plot logarithmically. Thereby the base should be 2. I had success when I tried base=2 instead of basey=2.

plt.yscale("log",base=2) 

This should also work with the latest version of matplotlib.

like image 120
Chris Avatar answered Oct 17 '25 07:10

Chris