Scatter2D Chart

A scatterplot displays the relationship between 2 numeric variables. For each data point, the value of its first variable is represented on the X axis, the second on the Y axis.



Color Themes


{
   "y" : {
      "data" : [
        [0,0],
        [8,-0.6],
        [16,-0.7],
        [24,-0.7],
        [32,-0.7],
        [40,-0.7],
        [48,-0.65],
        [56,-0.7],
        [0,0],
        [8,0.5],
        [16,0.7],
        [0,0],
        [8,0.3],
        [16,0.4],
        [24,0.6],
        [0,0],
        [8,-0.1],
        [16,-0.3],
        [24,-0.2],
        [32,-0.4],
        [40,-0.5],
        [0,0],
        [8,-0.4],
        [16,-0.5],
        [24,-0.55],
        [32,-0.55],
        [40,-0.4],
        [48,-0.7],
        [58,-0.8]
      ],
      "smps" : ["Weeks","Change From Baseline %"]
   },
   "z" : {
      "Response" : ["Complete Response","Complete Response","Complete Response","Complete Response","Complete Response","Complete Response","Complete Response","Complete Response","Progressive Disease","Progressive Disease","Progressive Disease","Progressive Disease","Progressive Disease","Progressive Disease","Progressive Disease","Partial Response","Partial Response","Partial Response","Partial Response","Partial Response","Partial Response","Partial Response","Partial Response","Partial Response","Partial Response","Partial Response","Partial Response","Partial Response","Partial Response"],
      "Subject" : ["S101810","S101810","S101810","S101810","S101810","S101810","S101810","S101810","S103101","S103101","S103101","S103105","S103105","S103105","S103105","S103201","S103201","S103201","S103201","S103201","S103201","S103205","S103205","S103205","S103205","S103205","S103205","S103205","S103205"]
   }
}
{
   "colorBy" : "Response",
   "graphType" : "Scatter2D",
   "legendBox" : "true",
   "legendInside" : "true",
   "legendPosition" : "topRight",
   "spiderBy" : "Subject",
   "theme" : "CanvasXpress",
   "title" : "Tummor Response by Week",
   "xAxis" : ["Weeks"],
   "yAxis" : ["Change From Baseline %"]
}
library(canvasXpress)
y=read.table("https://www.canvasxpress.org/data/cX-spider-dat.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
z=read.table("https://www.canvasxpress.org/data/cX-spider-var.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
canvasXpress(
  data=y,
  varAnnot=z,
  colorBy="Response",
  graphType="Scatter2D",
  legendBox=TRUE,
  legendInside=TRUE,
  legendPosition="topRight",
  spiderBy="Subject",
  theme="CanvasXpress",
  title="Tummor Response by Week",
  xAxis=list("Weeks"),
  yAxis=list("Change From Baseline %")
)