无法在R qplot中显示x轴标签

时间:2023-01-25 02:43:28

Try as I might, I can't seem to get qplot to print an x axis label when using facets. Reproducible toy example (requires diamonds dataset which I think comes with ggplot2):

尽我所能,我似乎无法让qplot在使用facet时打印x轴标签。可重复的玩具示例(需要我认为附带ggplot2的钻石数据集):

dsmall <- diamonds[sample(nrow(diamonds), 100), ]
qplot(color,price,data=dsmall ,facets=cut~.,xlab="TEST")

How do I add an x axis label to this?

如何为此添加x轴标签?

1 个解决方案

#1


1  

Resize the window (just make it a hair smaller by clicking on the lower right corner and dragging a bit) or save the plot as a PDF to see the x axis label.

调整窗口大小(通过单击右下角并稍微拖动可使头发变小)或将图表另存为PDF以查看x轴标签。

I think this may be a bug in the Mac version of R. Maybe a Lion issue with its fancier windows? Doesn't seem like anyone else is noticing this problem. Would be nice to get confirmation from someone else using the Mac R64 binary 2.15.0 with ggplot2 0.9.1 on Mac OS X 10.7.4, and I'll submit a bug report.

我认为这可能是Mac版R中的一个错误。也许是一个狮子问题与其更漂亮的窗口?似乎没有其他人注意到这个问题。很高兴在Mac OS X 10.7.4上使用Mac R64二进制2.15.0和ggplot2 0.9.1获得其他人的确认,我将提交错误报告。

Before resizing the Quartz window: 无法在R qplot中显示x轴标签 After resizing, the label magically appears: 无法在R qplot中显示x轴标签

在调整Quartz窗口大小之前:调整大小后,标签会神奇地出现:

#1


1  

Resize the window (just make it a hair smaller by clicking on the lower right corner and dragging a bit) or save the plot as a PDF to see the x axis label.

调整窗口大小(通过单击右下角并稍微拖动可使头发变小)或将图表另存为PDF以查看x轴标签。

I think this may be a bug in the Mac version of R. Maybe a Lion issue with its fancier windows? Doesn't seem like anyone else is noticing this problem. Would be nice to get confirmation from someone else using the Mac R64 binary 2.15.0 with ggplot2 0.9.1 on Mac OS X 10.7.4, and I'll submit a bug report.

我认为这可能是Mac版R中的一个错误。也许是一个狮子问题与其更漂亮的窗口?似乎没有其他人注意到这个问题。很高兴在Mac OS X 10.7.4上使用Mac R64二进制2.15.0和ggplot2 0.9.1获得其他人的确认,我将提交错误报告。

Before resizing the Quartz window: 无法在R qplot中显示x轴标签 After resizing, the label magically appears: 无法在R qplot中显示x轴标签

在调整Quartz窗口大小之前:调整大小后,标签会神奇地出现: