Logistic regression is often used to identify the effect of $x$ on a binary variable $y$ after adjusting for potential confounders $x_1,...,x_n$. In the medical literature, I will sometimes encounter a statement as follows:
The relationships between $x_1,...,x_n$ and $y$ were each evaluated to identify non-linear relationships. When a non-linear relationship was identified, cut-offs were visually chosen to categorize the variable.
That is, the non-linear nature of the relationship was "accounted for" by categorization. As expounded upon here and elsewhere, this is not good practice for a number of reasons.
The issues with this approach not-withstanding, I realize that I am not sure exactly how this visualization can be done. The most obvious interpretation is that they are visualizing the $x_i$ vs. $y$ plots for each $i$. However, this does not account for correlations between the $x_i$. That is, if $x_1$ and $x_2$ are not independent, then the relationship between $y$ and $x_1$ might be affected by inclusion of $x_2$ in the model--potentially rendering the cut-offs meaningless.
How can one visualize the relationship between $y$ and $x_i$ while adjusting for the other $x_j$ for $j\neq i$? I think this can be done by regressing all the other $x_j$ to $y$, and then somehow plotting the residual against $x_i$. Would this be the "correct" procedure? If the relationship between $y$ and $x_i$ changes when you include $x_j$ for $j\neq i$, then in what "order" would you then categorize the variables?
Again, this is not a question about the pitfalls of categorization. Rather, I am trying to understand how categorization by visualization could even be done in the first place, when the relationship between $x_i$ and $y$ is affected by the other covariates.