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

plotting cbar on another axis #8

Open
rainbowsend opened this issue Jul 24, 2020 · 1 comment
Open

plotting cbar on another axis #8

rainbowsend opened this issue Jul 24, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@rainbowsend
Copy link

I plot the colorbar on another axis (so I can align the scaleogram and the actual signal, vertically)

fig = plt.figure(constrained_layout=True)
gs = fig.add_gridspec(2, 2, width_ratios=[0.95, 0.05])
    
ax1 = fig.add_subplot(gs[0, 0])
ax2 = fig.add_subplot(gs[1, 0])
ax3 = fig.add_subplot(gs[1, 1])

ax1.plot(time,signal)

scg.cws(time, signal, ax=ax2, cbarkw={ 'cax':ax3 })

In this case the coi-line is plotted on the last added axis, here ax3 which is used for the colorbar.

This issue can be resolved by changing plt to ax in cws.py line 262

# plot the mask and forward user parameters
 ax.plot(xmesh, ymask)
@alsauve
Copy link
Owner

alsauve commented Oct 24, 2021

Duly noted, thanks @rainbowsend for the report, I will apply the change soon with a bunch of other small fixes.

@alsauve alsauve self-assigned this Oct 24, 2021
@alsauve alsauve added the bug Something isn't working label Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants