Re-name axes from itemplot() in two dimensional MIRT

108 views
Skip to first unread message

Garett Howardson

unread,
Mar 5, 2015, 5:09:02 PM3/5/15
to mirt-p...@googlegroups.com
I couldn't find a thread about this so I apologize if I'm just missing it. I'm trying to plot item trace curves for a two dimensional MIRT and I'd like to rename the x and y axes from theta1 and theta2 to custom labels. From the documentation, it seems I should just be able to pass xlab and ylab arguments to itemplot(), which should then be passed to lattice, e.g., 

itemplot(chaffect.fit.pre.dom, 1, rot=list(xaxis=-55, yaxis=30, zaxis=25), xlab='Approach', ylab='Avoid', zlab='Skills', main="Title")

However, I receive the following error when trying to do so: 

Error in cloud.formula(x = P ~ Theta1 + Theta2, data = list(Theta1 = c(-6,  :
  formal argument "xlab" matched by multiple actual arguments


I've also tried including all of the itemplot() arguments and then passing in the additional arguments

itemplot(chaffect.fit.pre.dom, 1, type = "trace", degrees = 45, CE = FALSE, CEalpha = 0.05, CEdraws = 1000, drop.zeros = FALSE, rot = list(xaxis = -70, yaxis = 30, zaxis = 10), theta_lim = c(-6, 6), shiny = FALSE, xlab="approach", ylab="avoid")

but I get the same error. I can pass a 'main =' argument but the xlab and ylab seem to be a no-go. Any thoughts? 

Phil Chalmers

unread,
Mar 5, 2015, 5:16:17 PM3/5/15
to Garett Howardson, mirt-package
You've stumbled upon an area where I had to cut some corners to make itemplot() highly general. You still can edit the plot the way you need, because lattice is the system used here and the internals are always exposed. E.g.,

```
mod <- mirt(Science, 2)
plt <- itemplot(mod, 1)
print(plt)
str(plt)
plt$panel.args.common$xlab <- 'my label'
plt$panel.args.common$ylab <- 'my other label'
print(plt)
```

Cheers.

Phil

--
You received this message because you are subscribed to the Google Groups "mirt-package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Garett Howardson

unread,
Mar 5, 2015, 5:19:50 PM3/5/15
to mirt-p...@googlegroups.com
Got it. That'll be perfect. Thanks Phil!

--
You received this message because you are subscribed to a topic in the Google Groups "mirt-package" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mirt-package/vzvbKfZWHZ0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mirt-package...@googlegroups.com.

Garett Howardson

unread,
Mar 5, 2015, 5:26:48 PM3/5/15
to mirt-p...@googlegroups.com, garett.h...@gmail.com
Also just as a follow up, I did see you recommend something like that on another thread but I didn't make the connection. I should have looked a bit harder. 
Reply all
Reply to author
Forward
0 new messages