RamanSPy icon indicating copy to clipboard operation
RamanSPy copied to clipboard

Allow cmap argument override in ramanpsy.plot.image kwargs

Open nihauc12 opened this issue 8 months ago • 3 comments

Hello and first thx for this library, it looks really nice and we are considering building on it in our company :)

This PR is a small one: use case is if we want to do something like:

ax = ramanspy.plot.image(
    [data], cmap="inferno"
)

at the moment it raises an error:

TypeError: matplotlib.axes._axes.Axes.imshow() got multiple values for keyword argument 'cmap'

Since cmap argument is defined from color in the plot function. This PR changes that so it takes cmap from plt_kwargs if present, if not it falls back to previous behaviour (building cmap from color)

Let me know what you think :)

nihauc12 avatar Nov 01 '23 12:11 nihauc12

Hello, thx for the review, good points, should have thought about the doc.

Could not use your simplification because the cmap variable was needed later in the call of the ax.figure.colorbar function.

So I changed the implementation a tiny bit. The cmap argument is now declared as an argument of the function, defaults to None, in my opinion it makes the code a bit cleaner after.

Added the declaration in the docstring (should update the doc if I followed properly)

Added same modifications to the volume function.

Let me know what you think

nihauc12 avatar Nov 10 '23 18:11 nihauc12

Hello @dgeorgiev21 any news on this ?

nihauc12 avatar Dec 01 '23 12:12 nihauc12

Hey @nihauc12 :)

We have not yet merged your changes because: 1) we wanted to finish setting up how we will be managing contributions and extensions (see our new contribution guide for more information); 2) we are still finalising the core infrastructure of the package.

We will start incorporating your changes and other extensions as soon as possible!

Thank you for your patience! :)

dgeorgiev21 avatar Dec 18 '23 10:12 dgeorgiev21