LouisFaure / scFates

a scalable python suite for tree inference and advanced pseudotime analysis from scRNAseq data.
https://scfates.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
47 stars 1 forks source link

error: keyword grid_b is not recognized with scf.pl.slide_cors #15

Closed pchiang5 closed 1 year ago

pchiang5 commented 1 year ago

Hello,

I encountered another problem at the scf.pl.slide_cors(adata,root_milestone="Root",milestones=["DC","Mono"],basis="draw_graph_fa",win_keep=[0,2,3,4,5], focus=2). I followed the tutorial here https://scfates.readthedocs.io/en/latest/Tree_Analysis_Bone_marrow_fates.html#Bifurcation-analysis with both my own dataset and the example dataset in the tutorial. Every step before it was good.

Is it a version issue with my plotting console and how shall I fix it?

In [35]: scf.pl.slide_cors(adata,root_milestone="Root",milestones=["DC","Mono"],basis="draw_graph_fa",win_keep=[0,2,3,4, ...: 5], ...: focus=2)

ValueError Traceback (most recent call last) Cell In[35], line 1 ----> 1 scf.pl.slide_cors(adata,root_milestone="Root",milestones=["DC","Mono"],basis="draw_graph_fa",win_keep=[0,2,3,4,5], 2 focus=2)

File /home/pc/miniconda3/envs/scFates-gpu/lib/python3.8/site-packages/scFates/plot/slide_cors.py:205, in slide_cors(adata, root_milestone, milestones, col, basis, win_keep, frame_emb, focus, top_focus, labels, fig_height, fontsize, fontsize_focus, point_size, show, save, kwargs_text, kwargs_con, kwargs_adjust, **kwargs) 195 ax_emb.set_ylabel("") 197 ax_emb.scatter( 198 emb[np.argsort(freq), 0], 199 emb[np.argsort(freq), 1], (...) 203 rasterized=True, 204 ) --> 205 ax_emb.grid(b=None) 206 ax_emb.set_xticks([]) 207 ax_emb.set_yticks([])

File /home/pc/miniconda3/envs/scFates-gpu/lib/python3.8/site-packages/matplotlib/axes/_base.py:3194, in _AxesBase.grid(self, visible, which, axis, kwargs) 3192 _api.check_in_list(['x', 'y', 'both'], axis=axis) 3193 if axis in ['x', 'both']: -> 3194 self.xaxis.grid(visible, which=which, kwargs) 3195 if axis in ['y', 'both']: 3196 self.yaxis.grid(visible, which=which, **kwargs)

File /home/pc/miniconda3/envs/scFates-gpu/lib/python3.8/site-packages/matplotlib/axis.py:1660, in Axis.grid(self, visible, which, kwargs) 1657 if which in ['major', 'both']: 1658 gridkw['gridOn'] = (not self._major_tick_kw['gridOn'] 1659 if visible is None else visible) -> 1660 self.set_tick_params(which='major', gridkw) 1661 self.stale = True

File /home/pc/miniconda3/envs/scFates-gpu/lib/python3.8/site-packages/matplotlib/axis.py:932, in Axis.set_tick_params(self, which, reset, **kwargs) 919 """ 920 Set appearance parameters for ticks, ticklabels, and gridlines. 921 (...) 929 gridlines. 930 """ 931 _api.check_in_list(['major', 'minor', 'both'], which=which) --> 932 kwtrans = self._translate_tick_params(kwargs) 934 # the kwargs are stored in self._major/minor_tick_kw so that any 935 # future new ticks will automatically get them 936 if reset:

File /home/pc/miniconda3/envs/scFates-gpu/lib/python3.8/site-packages/matplotlib/axis.py:1076, in Axis._translate_tickparams(kw, reverse) 1074 for key in kw: 1075 if key not in allowed_keys: -> 1076 raise ValueError( 1077 "keyword %s is not recognized; valid keywords are %s" 1078 % (key, allowedkeys)) 1079 kwtrans.update(kw) 1080 return kwtrans

ValueError: keyword grid_b is not recognized; valid keywords are ['size', 'width', 'color', 'tickdir', 'pad', 'labelsize', 'labelcolor', 'zorder', 'gridOn', 'tick1On', 'tick2On', 'label1On', 'label2On', 'length', 'direction', 'left', 'bottom', 'right', 'top', 'labelleft', 'labelbottom', 'labelright', 'labeltop', 'labelrotation', 'grid_agg_filter', 'grid_alpha', 'grid_animated', 'grid_antialiased', 'grid_clip_box', 'grid_clip_on', 'grid_clip_path', 'grid_color', 'grid_dash_capstyle', 'grid_dash_joinstyle', 'grid_dashes', 'grid_data', 'grid_drawstyle', 'grid_figure', 'grid_fillstyle', 'grid_gapcolor', 'grid_gid', 'grid_in_layout', 'grid_label', 'grid_linestyle', 'grid_linewidth', 'grid_marker', 'grid_markeredgecolor', 'grid_markeredgewidth', 'grid_markerfacecolor', 'grid_markerfacecoloralt', 'grid_markersize', 'grid_markevery', 'grid_mouseover', 'grid_path_effects', 'grid_picker', 'grid_pickradius', 'grid_rasterized', 'grid_sketch_params', 'grid_snap', 'grid_solid_capstyle', 'grid_solid_joinstyle', 'grid_transform', 'grid_url', 'grid_visible', 'grid_xdata', 'grid_ydata', 'grid_zorder', 'grid_aa', 'grid_c', 'grid_ds', 'grid_ls', 'grid_lw', 'grid_mec', 'grid_mew', 'grid_mfc', 'grid_mfcalt', 'grid_ms']

LouisFaure commented 1 year ago

This is due to a newer version of matplotlib, I have updated the code on a development branch, tests are passing, but I cannot check if the plots are looking similar to the tutorial ones, could you check if this is working on your side? by installing via:

pip install git+https://github.com/LouisFaure/scFates@v1.0.1dev

If all is fine I will merge this and create a new pypi release!

pchiang5 commented 1 year ago

The dev branch worked with me. Thank you.