Skip to main content
added 294 characters in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929

ArrayPlot

ArrayPlot[SparseArray[1 + {#2, #} -> Hue @ #3 & @@@ xyz], 
 DataReversed -> True, 
 FrameTicks -> Table[{# + 1/2, #} & /@ Range[0, 10], 4], 
 PlotLegends -> legend]

enter image description here

Update

Update

ArrayPlot

ArrayPlot[SparseArray[1 + {#2, #} -> Hue @ #3 & @@@ xyz], 
 DataReversed -> True, 
 FrameTicks -> Table[{# + 1/2, #} & /@ Range[0, 10], 4], 
 PlotLegends -> legend]

enter image description here

Update

added 393 characters in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929

ListPlot

Legended[ReplaceAll[Point -> (Rectangle@*First)]@
  ListPlot[List /@ xyz[[All, ;; 2]], 
   PlotStyle -> Hue /@ xyz[[All, -1]], BaseStyle -> EdgeForm[Gray], 
   AspectRatio -> 1, Frame -> True, PlotRange -> {{0, 10}, {0, 11}}, 
   PlotRangePadding -> .2], legend]

enter image description here

Update

Update

ListPlot

Legended[ReplaceAll[Point -> (Rectangle@*First)]@
  ListPlot[List /@ xyz[[All, ;; 2]], 
   PlotStyle -> Hue /@ xyz[[All, -1]], BaseStyle -> EdgeForm[Gray], 
   AspectRatio -> 1, Frame -> True, PlotRange -> {{0, 10}, {0, 11}}, 
   PlotRangePadding -> .2], legend]

enter image description here

Update

added 415 characters in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929

Replace Hue with ColorData["M10DefaultDensityGradient"] to use the default color scheme for DensityPlot:

barlegend1 = BarLegend[{"M10DefaultDensityGradient", MinMax@xyz[[All, -1]]}];
barlegend2 = BarLegend[{"M10DefaultDensityGradient", MinMax@xyz[[All, -1]]}, 
   xyz[[All, -1]]];

Row[{barlegend1, barlegend2}, Spacer[20]]

enter image description here

Legended[Graphics[{EdgeForm[Gray], Opacity[1], 
   ColorData["M10DefaultDensityGradient"] @ #3, Rectangle[{#, #2}]} & @@@ xyz, 
   Frame -> True], 
  barlegend2]

enter image description here

BubbleChart[xyz, 
 ChartStyle -> (ColorData["M10DefaultDensityGradient"] /@ xyz[[All, -1]]), 
 ChartElementFunction -> (Rectangle[Mean /@ #] &), 
 PlotRange -> {{0, 11}, {0, 11}}, ChartLegends -> barlegend2]

enter image description here

For DensityHistogram, just remove the option ColorFunction -> Hue:

DensityHistogram[WeightedData[xyz[[All, ;; 2]], xyz[[All, -1]]], {1}, 
 ChartElementFunction -> (Rectangle[Mean /@ #] &), 
 ChartLegends -> BarLegend[Automatic, xyz[[All, -1]]]]

enter image description here

Replace Hue with ColorData["M10DefaultDensityGradient"] to use the default color scheme for DensityPlot:

barlegend1 = BarLegend[{"M10DefaultDensityGradient", MinMax@xyz[[All, -1]]}];
barlegend2 = BarLegend[{"M10DefaultDensityGradient", MinMax@xyz[[All, -1]]}, 
   xyz[[All, -1]]];

Row[{barlegend1, barlegend2}, Spacer[20]]

enter image description here

Legended[Graphics[{EdgeForm[Gray], Opacity[1], 
   ColorData["M10DefaultDensityGradient"] @ #3, Rectangle[{#, #2}]} & @@@ xyz, 
   Frame -> True], 
  barlegend2]

enter image description here

BubbleChart[xyz, 
 ChartStyle -> (ColorData["M10DefaultDensityGradient"] /@ xyz[[All, -1]]), 
 ChartElementFunction -> (Rectangle[Mean /@ #] &), 
 PlotRange -> {{0, 11}, {0, 11}}, ChartLegends -> barlegend2]

enter image description here

For DensityHistogram, just remove the option ColorFunction -> Hue:

DensityHistogram[WeightedData[xyz[[All, ;; 2]], xyz[[All, -1]]], {1}, 
 ChartElementFunction -> (Rectangle[Mean /@ #] &), 
 ChartLegends -> BarLegend[Automatic, xyz[[All, -1]]]]

enter image description here

added 415 characters in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929
Loading
added 415 characters in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929
Loading
added 328 characters in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929
Loading
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929
Loading