• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home » Resolved: Set Axis Limits of mixfitEM plot

Resolved: Set Axis Limits of mixfitEM plot

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I want to set limits to the x-axis of the plot of the output of the mixfit function of the mixR package. This output is of class mixfitEM.
Reproducable example: First I simulate a mixture of log normals.
produces the following error:

Answer:

When you call plot 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:
enter image description here

If you have better answer, please add a comment about this, thank you!

ggplot2 mixture-model plot r
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Openlayers: Update clusters depending on filter (geometryFunction)

24/03/2023

Resolved: Getting ‘502 Bad Gateway’ while deploying Springboot app in EKS

24/03/2023

Resolved: Why is NGINX’s $request_uri empty?

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.