Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm close, but I'm stuck.

Here's my code so far:

data = Import["http://www.powerball.com/powerball/winnums-text.txt", 
   "Table", "HeaderLines" -> 1];

clipped = Take[data[[All, 2 ;; 7]]];

ListPointPlot3D[clipped];

balls = Take[clipped[[All, 1 ;; 6]]];

whiteballs = Take[balls, 10];

sorted = Map[Sort, whiteballs];

p = ListPlot3D[sorted, Mesh -> All, InterpolationOrder -> 0, 
  ColorFunction -> "TemperatureMap"]

labels = Graphics3D[Text[ToString@Round[#, 1], #, {0, 0}]] & /@ 
  Take[sorted[[All, 1 ;; 3]]]

Show[{p, labels}]

I would like to have the ball numbers placed on top of each of the colored squares, but I'm out of ideas.

share|improve this question
    
They are here, see here for a smaller set of data. –  Öskå Jul 18 at 16:54

1 Answer 1

Update: BubbleChart with a custom ChartElementFunction:

bcdata = MapIndexed[Join[#2, {#1, 1}] &, whiteballs, {-1}]; 
         (* transform data to a form acceptable for BarChart3D *)

ceF[ind_:3, sz_:36, c_:Black][{{xmin_, xmax_}, {ymin_, ymax_},{zmin_, zmax_}}, v_, m_] := 
  Dynamic@Module[{vtc = {{0, 0}, {0, 1}, {1, 1}, {1, 0}}},
    {EdgeForm[{Darker@CurrentValue["Color"], Thick}], 
     FaceForm[Texture[Framed[Style[ToString@(Floor /@ v[[ind]]), sz, Bold, c], 
                      Background -> Lighter@CurrentValue["Color"]]]], 
     Polygon[{{xmin, ymin, (zmin + zmax)/2}, 
              {xmin, ymax, (zmin + zmax)/2}, 
              {xmax, ymax, (zmin + zmax)/2}, 
              {xmax, ymin, (zmin + zmax)/2}}, VertexTextureCoordinates -> vtc]}]

Examples:

BubbleChart3D[bcdata, ChartElementFunction -> ceF[], 
    ColorFunction -> Function[{x, y, z, r}, ColorData["TemperatureMap"][z]], 
    BoxRatios -> 1, ImageSize -> 500]

enter image description here

BubbleChart3D[bcdata, ChartElementFunction -> ceF[;; 3, 24, Black], 
     ColorFunction -> Function[{x, y, z, r}, ColorData["TemperatureMap"][z]], 
     BoxRatios -> 1, ImageSize -> 500]

enter image description here


Original post: Post-processing the output of ListPointPlot3D using Texture:

lpp = ListPointPlot3D[whiteballs, 
         PlotRangePadding -> 1, 
         PlotStyle -> PointSize[.03], ColorFunction -> "TemperatureMap", 
         Lighting -> "Neutral", ImageSize -> 500, BoxRatios -> 1]

enter image description here

vtc = {{0, 0}, {0, 1}, {1, 1}, {1, 0}};
lpp /. Hue[___] :> Sequence[] /. 
    {sty : RGBColor[__], Point[x_, ___]} :>
      ({EdgeForm[{Darker@sty, Thick}], 
        FaceForm[Texture[Framed[Style[ToString@(Floor /@ x), 64, Bold], 
                                Background -> Lighter@sty]]], 
        Polygon[x + # & /@ {{-.5, -.5, 0}, {-.5, .5, 0}, {.5, .5, 0}, {.5, -.5, 0}}, 
                VertexTextureCoordinates -> vtc]})

enter image description here

share|improve this answer
    
muchos gracias! –  foster2 Oct 2 at 11:47
    
@foster2, my pleasure. If you found the answer useful, you might consider Accepting it by clicking the accept button on the left:) –  kguler Oct 2 at 11:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.