Question:
I want to set limits to the x-axis of the plot of the output of themixfit
function of the mixR
package. This output is of class mixfitEM
.Reproducable example: First I simulate a mixture of log normals.
Answer:
When you callplot
on the mixfitEM
object, you are creating a ggplot. The reason for this is that plot
is a generic function, so when package authors create a new class, they are free to use whatever method they want to draw the plot. In this case, if you examine the source code of mixR:::plot.mixfitEM
you will see it actually uses ggplot to draw its output. This means you can use ggplot syntax to modify the output:
If you have better answer, please add a comment about this, thank you!