Skip to content

Get rid of top and bottom spaces in dot plots - #1270

Closed
falexwolf wants to merge 2 commits into
masterfrom
falexwolf-patch-3
Closed

falexwolf wants to merge 2 commits into
masterfrom
falexwolf-patch-3

Conversation

@falexwolf

Copy link
Copy Markdown
Member

@fidelram, I'm not sure whether I'm breaking things you intended differently. But for us, this removes the strange scaling of the white space above and below the dots, and makes it behave like the x-axis.

Just a suggestion, no need to follow up.

fidelram added a commit that referenced this pull request Jul 13, 2020
…s to style(); added padding parameter to style to address #1270; add legend width units to documentation.
fidelram added a commit that referenced this pull request Jul 13, 2020
…s to style(); added padding parameter to style to address #1270; add legend width units to documentation. (#1316)
@fidelram

Copy link
Copy Markdown
Collaborator

@falexwolf I added a padding argument to dotplot (already merged into master):

adata = sc.datasets.pbmc68k_reduced()
markers = {'T-cell': ['CD3D', 'CD3E', 'IL32'], 'B-cell': ['CD79A', 'CD79B', 'MS4A1'], 'myeloid': ['CST3', 'LYZ']}
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12,5), gridspec_kw={'width_ratios': [1.2, 1], 'wspace':0.6}, sharex=False, sharey=False)
ax1 = sc.pl.dotplot(adata, markers, groupby='bulk_labels', ax=ax1, dendrogram=True, show=False)
ax2 = sc.pl.dotplot(adata, markers, groupby='bulk_labels', ax=ax2, dendrogram=True, show=False, return_fig=True).\
    style(x_padding=0.5, y_padding=0.5, cmap='Reds').show()

image

The units for the x_padding and y_padding are in ticks distance.

esrice pushed a commit to WarrenLab/scanpy that referenced this pull request Jul 15, 2020
…s to style(); added padding parameter to style to address scverse#1270; add legend width units to documentation. (scverse#1316)
@ivirshup

Copy link
Copy Markdown
Member

I think we're good to close this PR then, right? Let me know if I should reopen it.

@ivirshup ivirshup closed this Dec 13, 2020
@flying-sheep
flying-sheep deleted the falexwolf-patch-3 branch October 30, 2023 13:23
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.

3 participants