plot with gapped( discontinuous) y axis: using GG.gap and plotrix package

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024

ความคิดเห็น • 12

  • @tulikabhardwaj484
    @tulikabhardwaj484 3 ปีที่แล้ว

    This graph occurred very user friendly and good visualization

    • @DevResearch
      @DevResearch  3 ปีที่แล้ว

      Thanks for appreciation.

  • @mokshmahajan6412
    @mokshmahajan6412 ปีที่แล้ว

    If i want to gap in y axis label suppose i have to write some trait and below it , i want to write its symbol, how can we add

  • @ankursharma2775
    @ankursharma2775 2 ปีที่แล้ว

    Can we add multiple gaps on the x-axis using R package like plotrix?

  • @daniostr
    @daniostr 2 ปีที่แล้ว

    Any option to create plotrix gap in ggplot?

    • @DevResearch
      @DevResearch  2 ปีที่แล้ว

      No. gg.gap can introduce gaps in ggplot, but that's not possible with plotrix. plotrix is based on r base graphics and it gives better plots than gg.gap. try the following code
      df

  • @gedarahome1146
    @gedarahome1146 3 ปีที่แล้ว

    Very helpful video. I see the legend disappears with gg.gap function. Is there a way to add it again?

    • @DevResearch
      @DevResearch  3 ปีที่แล้ว

      I didn't notice that. Will see the code again and revert back.

    • @DevResearch
      @DevResearch  3 ปีที่แล้ว +1

      Legend need to ba added explicitly to plot object. This us example from gg.gap documentation.
      library(ggplot2)
      mtcars$gear

  • @natalihernandez1537
    @natalihernandez1537 2 ปีที่แล้ว

    Thank you for the video! Is there a way to use gg.gap in the x axis?

    • @DevResearch
      @DevResearch  2 ปีที่แล้ว

      library(ggplot2)
      library(ggbreak)
      ggplot(iris,aes(Sepal.Length,Petal.Length,color=Species))+
      geom_point()+
      scale_x_break(c(5, 6.5))
      the overlap of axis tick labels at break is not addressed yet. also both the axis can not havde gap simaltaneously. for multiple gaps multiple scale_x_break() statements have to used. Its a recent package, published day before yesterday.