Skip to content

plotting cbar on another axis #8

@rainbowsend

Description

@rainbowsend

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)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions