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


{
   "m" : {
      "Description" : "Data on the time subjects required to complete a pencil and paper maze when they were smelling a floral scent and when they were not.",
      "Name" : "Scents",
      "Reference" : "Hirsch, A. R., and Johnston, L. H. Odors and Learning, Smell & Taste Treatment and Research Foundation, Chicago."
   },
   "y" : {
      "data" : [
        [38.4,27.7,25.7,53.1,30.6,30.2],
        [46.2,57.2,41.9,54.7,43.3,56.7],
        [72.5,57.9,51.9,74.2,53.4,42.4],
        [38,38,32.2,49.6,37.4,34.4],
        [82.8,57.9,64.7,53.6,48.6,44.8],
        [33.9,32,31.4,51.3,35.5,42.9],
        [50.4,40.6,40.1,44.1,46.9,42.7],
        [35,33.1,43.2,34,26.4,24.8],
        [32.8,26.8,33.9,34.5,25.1,25.1],
        [60.1,53.2,40.4,59.1,87.1,59.2],
        [75.1,63.1,58,67.3,43.8,42.2],
        [57.6,57.7,61.5,75.5,126.6,48.4],
        [55.5,63.3,44.6,41.1,41.8,32],
        [49.5,45.8,35.3,52.2,53.8,48.1],
        [40.9,35.7,37.2,28.3,26,33.7],
        [44.3,46.8,39.4,74.9,45.3,42.6],
        [93.8,91.9,77.4,77.5,55.8,54.9],
        [47.9,59.9,52.8,50.9,58.6,64.5],
        [75.2,54.1,63.6,70.1,44,43.1],
        [46.2,39.3,56.6,60.3,47.8,52.8],
        [56.3,45.8,58.9,59.9,36.8,44.3]
      ],
      "desc" : ["time in seconds"],
      "smps" : ["U-Trial 1","U-Trial 2","U-Trial 3","S-Trial 1","S-Trial 2","S-Trial 3"],
      "vars" : ["s1","s2","s3","s4","s5","s6","s7","s8","s9","s10","s11","s12","s13","s14","s15","s16","s17","s18","s19","s20","s21"]
   },
   "z" : {
      "Age" : [23,43,43,32,15,37,26,35,26,31,35,55,25,39,25,26,33,62,54,38,65],
      "Opinion" : ["pos","neg","pos","neg","neg","pos","pos","pos","pos","indiff","pos","indiff","pos","indiff","indiff","pos","neg","neg","pos","neg","neg"],
      "Order" : ["1","2","1","2","1","2","1","2","1","2","1","2","1","2","1","2","1","2","1","2","1"],
      "Sex" : ["M","F","M","M","M","F","F","F","M","F","F","F","F","M","M","M","M","M","F","F","M"],
      "Smoker" : ["N","Y","N","N","N","Y","N","N","N","N","Y","Y","Y","Y","N","N","Y","N","Y","N","N"]
   }
}
{
   "citation" : "Hirsch, A. R., and Johnston, L. H. Odors and Learning, Smell & Taste Treatment and Research Foundation, Chicago.",
   "graphType" : "Scatter2D",
   "histogramStat" : "count",
   "legendBox" : "true",
   "setMaxX" : "100",
   "setMaxY" : "150",
   "setMinX" : "0",
   "setMinY" : "0",
   "shapeBy" : "Smoker",
   "showTransition" : "false",
   "sizeBy" : "Age",
   "theme" : "CanvasXpress",
   "title" : "Data on the time subjects required to complete a pencil and paper maze\\nwhen they were smelling a floral scent and when they were not.",
   "xAxis" : ["U-Trial 1","U-Trial 2","U-Trial 3"],
   "xAxisExact" : "true",
   "xAxisHistogramShow" : "true",
   "yAxis" : ["S-Trial 1","S-Trial 2","S-Trial 3"],
   "yAxisExact" : "true",
   "yAxisHistogramShow" : "true"
}
library(canvasXpress)
y=read.table("https://www.canvasxpress.org/data/cX-scentst-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-scentst-var.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
canvasXpress(
  data=y,
  varAnnot=z,
  citation="Hirsch, A. R., and Johnston, L. H. Odors and Learning, Smell & Taste Treatment and Research Foundation, Chicago.",
  graphType="Scatter2D",
  histogramStat="count",
  legendBox=TRUE,
  setMaxX=100,
  setMaxY=150,
  setMinX=0,
  setMinY=0,
  shapeBy="Smoker",
  showTransition=FALSE,
  sizeBy="Age",
  theme="CanvasXpress",
  title="Data on the time subjects required to complete a pencil and paper maze\nwhen they were smelling a floral scent and when they were not.",
  xAxis=list("U-Trial 1", "U-Trial 2", "U-Trial 3"),
  xAxisExact=TRUE,
  xAxisHistogramShow=TRUE,
  yAxis=list("S-Trial 1", "S-Trial 2", "S-Trial 3"),
  yAxisExact=TRUE,
  yAxisHistogramShow=TRUE
)