ggtern禁用了ggplot2的某些主题-仍然吗?

时间:2020-03-25 16:08:33

标签: r ggplot2 ggtern

我似乎遇到了与先前here相同的问题:将ggtern附加到ggplot2时,我收到此消息:

以下对象被“ package:ggplot2”屏蔽:

%+%, aes, annotate, calc_element, ggplot, ggplot_build, ggplot_gtable, ggplotGrob,
ggsave, layer_data, theme, theme_bw, theme_classic, theme_dark, theme_gray,
theme_light, theme_linedraw, theme_minimal, theme_void

2016年的解决方案是将ggtern的版本更新到2.1.4,但是,我现在使用ggtern的版本3.1.0(对于ggplot2使用3.3.0)。关于我可能做错了什么的任何想法?

1 个答案:

答案 0 :(得分:1)

只要有被遮罩的对象,就始终可以通过限定的调用(例如,使用SELECT DISTINCT t.* , tt.* FROM wp_terms t JOIN wp_termmeta ON t.term_id = wp_termmeta.term_id JOIN wp_termmeta mt1 ON t.term_id = mt1.term_id JOIN wp_termmeta mt2 ON t.term_id = mt2.term_id JOIN wp_term_taxonomy tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('episodes') AND wp_termmeta.meta_key = 'episode_number' AND mt1.meta_key = 'tr_id_post' AND mt1.meta_value = '7547' AND mt2.meta_key = 'season_number' AND mt2.meta_value = '2' ORDER BY wp_termmeta.meta_value+0 ASC; )指向该对象。

要亲自查看,请依次加载ggplot2::theme_bw()library(ggplot2)。如您所指示,此功能在library(ggtern)中被屏蔽。在我下面使用的情况下,所做的更改很小,但这说明了这一点。

仔细比较下面两行代码的输出,您会看到区别(我认为主要是在默认的轴刻度大小中):

不合格的通话。由于ggplot2被屏蔽,因此此代码使用的是theme_bw()中的ggtern

ggplot2::theme_bw()

合格的呼叫。该代码从ggplot2(iris, aes(x=Sepal.Length, y=Sepal.Width)) + geom_point() + theme_bw() 调用方法:

ggplot2
相关问题