ggplot2

    2熱度

    1回答

    我想讓我的情節中的動畫線在顏色高於50%時改變顏色,以顯示結果的差異。 我 「data.thesis」 框架是這樣的: 我假設的結局情節是在這裏。從而使黑線移動到可能的結果的代碼將動畫的情節: library(ggplot2) library(gganimate) z <- qnorm(0.33) sd <- (50 - 55)/z moe <- 1.96*sd data.thesi

    1熱度

    1回答

    我想創建一個漸變圖。我以爲用漸變填充我的geom_tile。然而,R不斷告訴我,Error: Discrete value supplied to continuous scale。 df <- data.frame(value=c(55, 40, 5), zz=c("A", "B", "C")) df$lower <- df$value-2.9 df$upper <- df$

    1熱度

    1回答

    我有一個geom_bar繪圖,標籤上顯示了每個條形圖的值。 這裏是產生積代碼: # libraries library(shiny) library(tidyverse) # funnel bar blot output$funnel_plot <- renderPlot({ ggplot(exampledf, aes(x = reorder(Funnel, -Sess

    1熱度

    1回答

    在刻面的曲線圖從ggplot2包能夠通過所述函數來改變刻度標記的位置等scale_x_continuous(position="top")。然而,如果刻度線的放置在上面,他們似乎上面刻面的面板,如下: library(ggplot2) ggplot(mpg, aes(displ, cty)) + geom_point() + facet_grid(. ~ cyl) +coord_flip()

    2熱度

    2回答

    這是這一個How to use superscript with ggplot2 類似的問題,但代替標籤的硬編碼值I在可變字符串,我需要追加「毫米^ 3」的字符串,並顯示在ggplot。 我有這樣的代碼: genericPlot <- genericPlot + labs(y = wrap(ylab, wrap.length)) #' Wrap #' #' @param x charact

    0熱度

    1回答

    編輯 - 包括以下 我已經使用this function與GGPLOT2包再現的例子Add a common Legend for combined ggplots其中工程perfecty當每個小區僅具有1型傳說例如爲...,color =, ...。 不過,我想安排其共用一個傳說多條曲線,但每個人都有一個額外的獨特傳奇如: ggplot(df1, aes(x=Site, y=RESULT, co

    1熱度

    1回答

    這裏有一個數據幀: library(tidyverse) example_df <- structure(list(Funnel = c("Sessions", "AddToCart", "Registrations", "ShippingDetails", "Checkout", "Transactions"), Sum = c(1437574, 385281, 148181, 56989,

    0熱度

    1回答

    我訪問了此網站以嘗試找到重疊問題的解決方案。 圖片摘自https://rstudio-pubs-static.s3.amazonaws.com/3364_d1a578f521174152b46b19d0c83cbe7e.html 但是,我仍然不知道如何解決它。 圖像:重疊 我的期望圖像: 我注意到axis.text.x重疊的一些解決方案,如使用scale_x_discrete(labels = a

    0熱度

    1回答

    目前,我可以創造的情節:使用 : df %>% ggplot(aes_string(age)) + facet_wrap(~CUSTOMER_GROUP, scales="free") + geom_histogram(binwidth = 3) + scale_y_continuous(labels=percent) + theme_igray(

    0熱度

    1回答

    我有一個問題,在使用ggplot製作的分組條形圖無意中在我的數據集中發生微小變化後轉換爲堆積條形圖。我有以下的初始數據集和條形圖: > DataT Treatment Round N Initial sd se ci 1 EE 1 3 3000.000 0.0000 0.00000 0.0000 2 EE 2 3 2524.444 463.8167 267.7846