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 have:

enter image description here

created with:

With[{stdOpt = {InterpolationOrder -> 0, 
GridLines -> {Range[10], Range[10]}, 
GridLinesStyle -> Directive[GrayLevel[0.8], Dashed], 
Joined -> True, AspectRatio -> 1}}, 
ListPlot[{0}, stdOpt, PlotRange -> {{0, 10}, {0, 10}}, Axes -> False,
Frame -> False, Epilog -> {

Black, Opacity[1.0],

Text[Style[1, Large, FontFamily -> "Times"], {0.5, 0.5}, 
 FormatType -> Bold],
Text[Style[2, Large, FontFamily -> "Times"], {0.5, 1.5}, 
 FormatType -> Bold],
Text[Style[3, Large, FontFamily -> "Times"], {0.5, 2.5}, 
 FormatType -> Bold],
Text[Style[4, Large, FontFamily -> "Times"], {0.5, 3.5}, 
 FormatType -> Bold],
Text[Style[5, Large, FontFamily -> "Times"], {0.5, 4.5}, 
 FormatType -> Bold],
Text[Style[6, Large, FontFamily -> "Times"], {0.5, 5.5}, 
 FormatType -> Bold],
Text[Style[7, Large, FontFamily -> "Times"], {0.5, 6.5}, 
 FormatType -> Bold],
Text[Style[8, Large, FontFamily -> "Times"], {0.5, 7.5}, 
 FormatType -> Bold],
Text[Style[9, Large, FontFamily -> "Times"], {0.5, 8.5}, 
 FormatType -> Bold],
Text[Style[10, Large, FontFamily -> "Times"], {0.5, 9.5}, 
 FormatType -> Bold]

}]]

and I would like to place (& correctly align) a column of numbers (from pre-made lists) for each of the 10 columns (rather than the manully placed numbers as they appear above).

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Random premade list:

SeedRandom@1;
m = 10; (* size of the grid *)
premade = RandomInteger[10, {m, m}];

column coordinates:

col[n_] := Table[{n - 0.5, i - 0.5}, {i, 1, m}]

And the wanted Graphics:

Graphics[
 {Table[
    Text[Style[premade[[#, i]], Large, FontFamily -> "Times"],col[i][[#]]] & /@ Range@m,
       {i, 1, m}]},
  GridLines -> {Range@m, Range@m}, PlotRange -> {{0, m}, {0, m}},
  Axes -> False, Frame -> True, GridLinesStyle -> Directive[GrayLevel[0.8], Dashed]]

enter image description here

share|improve this answer
    
@ Öskå, fantastic! - Just what I was after - super speedy reply too! :) –  martin Nov 21 '13 at 11:41
1  
You are welcome :) Check the edit for your "for each of the 10 columns" part of your question :) –  Öskå Nov 21 '13 at 11:50
    
@martin do you still need the pink Rectangles? –  Öskå Nov 21 '13 at 12:02
    
@ Öskå, not just yet ;) –  martin Nov 21 '13 at 12:06
    
I can edit with a few more lines placing random rectangles if it helps –  Öskå Nov 21 '13 at 12:07
show 1 more comment
SeedRandom@1;
m = 10;(*size of the grid*)

premade = Map[Text[Style[#, Large, FontFamily -> "Times"]] &,  RandomInteger[10, {m, m}], {2}];
Grid[premade, Frame -> All, FrameStyle -> Dashed, ItemSize -> 2.5]

Mathematica graphics

share|improve this answer
    
@ belisarius, thanks for your 'slimmer' version (in terms of amount of code needed) - very useful from a learning point of view :) –  martin Nov 21 '13 at 16:46
add comment

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.