Plotting Marginal Coefficient of Interaction with Marginal_Effects()

I’d really appreciate it if somebody can help me figure this out. I have a model with random intercepts and slopes, and I’d like to plot the marginal effect of x on y conditional on the level of z, with which x is interacted. Previously I’ve always understood marginal effect to mean exactly this: the instantaneous rate of change (coefficient) of x on y, for different levels of the interactor.

More specifically, my model looks like this: vote ~ imports*concentration + (1 + imports | county)
+ (1 | year) + (1 | state-year), where imports is a continuous predictor and my IV of interest, and concentration is a continuous mediator.

Is there a way to use marginal_effects() to plot the actual marginal effect of imports on vote on the y-axis, and not predicted values of y? If this isn’t possible with marginal_effects, is there a different package that might include this function, or am I left to compute this manually?

I am sorry, I am not sure I understand your question. What is it that you want to put on the y-axis?

Thanks for getting back, sorry for the vague wording. I’d like to have the marginal coefficient or magnitude of the effect of x on the y-axis, for various levels of z with which x is interacted. So instead of the curves of predicted values that marginal_effects() normally outputs, the actual slope of the relationship on the y-axis, for different levels of z, which is on the x-axis. The first figure in this blog post includes an example of what I’m referring to. Many thanks, and apologies for my lack of clarity.

there is no built-in function but you can build such a plot manually by extracting the posterior samples via posterior_samples and perform the necessary transformation on that basis.