Skip to content

Allow customizing carpet plot axis labels #137

@jhlegarreta

Description

@jhlegarreta

What would you like to see added in this software?

The carpet plot method assumes what is displayed on the x axis are time points:

xlabel = "time-points (index)"

For DWI, I think these should rather be diffusion gradient-encoding directions, so the x axis label should be a parameter of the method so that it can be changed.

Do you have any interest in helping implement the feature?

Yes

Additional information / screenshots

Slightly related, maybe I am not calling this method properly:

    fig = plt.figure(layout="tight")
    gs = gridspec.GridSpec(ncols=1, nrows=2, figure=fig)
    fig.suptitle("DWI signal carpet plot")

    divide_by_b0 = False
    gt_data, segments = nii_to_carpetplot_data(gt_nii, bvals=gtab.bvals, divide_by_b0=divide_by_b0)

    title = "Ground truth"
    plot_carpet(gt_data, segments, subplot=gs[0, :], title=title, **kwargs)

    gp_data, segments = nii_to_carpetplot_data(gp_nii, bvals=gtab.bvals, divide_by_b0=divide_by_b0)

    title = "Estimated (GP)"
    plot_carpet(gt_data, segments, subplot=gs[1, :], title=title, **kwargs)

    return fig

but the plot I get has the ylabel text cut:

Also, not sure where the vertical blue band I get in the upper subplot comes from.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions