2
$\begingroup$

The 2D lattice might be something like this:

\begin{array}{cccc} D&(E,D)&(F,D)&(G,D)\\ C&(E,C)&(F,C)&(G,C)\\ B&(E,B)&(F,B)&(G,B)\\ 0&E&F&G \end{array}

Is it possible to graph these custom axes in a 2D lattice, or even a 3D lattice with 3 custom axes, and also show the coordinates for each point in the space?

$\endgroup$
  • 2
    $\begingroup$ I don't find this question clearly posed. It looks like you have a 2D lattice. Is that correct? If so, then I don't see how a 3D graphic can be generated. A 2D graphic. can be generated easily from a numeric table (matrix) of the points. Custom labelling is certainly possible. That'a about all i can say without seeing your real data. $\endgroup$ – m_goldberg Nov 14 '19 at 5:17
3
$\begingroup$

Something like this maybe:

xs = {"E", "F", "G"};
ys = {"B", "C", "D"};

converter = {Thread[xs -> Range[Length[xs]]], Thread[ys -> Range[Length[ys]]]}
 (* {{"E" -> 1, "F" -> 2, "G" -> 3}, {"B" -> 1, "C" -> 2, "D" -> 3}} *)

pts = {{"E", "D"}, {"E", "C"}, {"E", "B"}, {"F", "D"}, {"F", 
    "C"}, {"F", "B"}, {"G", "D"}, {"G", "C"}, {"G", "B"}};

ListPlot[
 Callout[#[[1]], ToString[#[[2]]]] & /@ Transpose[{pts /. Flatten[converter], pts}], 
 PlotStyle -> PointSize[Large], 
 PlotRange -> {{0, Length[xs] + .5}, {0, Length[ys] + .5}}, 
 Ticks -> {{#[[1]], #[[2]]} & /@ Reverse[converter[[1]], 2], 
           {#[[1]], #[[2]]} & /@ Reverse[converter[[2]], 2]}]

enter image description here

In 3 dimensions:

(* Some z "values" *)
zs = {"H", "I", "J"};
converter = {Thread[xs -> Range[Length[xs]]], 
  Thread[ys -> Range[Length[ys]]], Thread[zs -> Range[Length[zs]]]}
 (* {{"E" -> 1, "F" -> 2, "G" -> 3}, {"B" -> 1, "C" -> 2, "D" -> 3}, {"H" -> 1, "I" -> 2, "J" -> 3}} *)

Making up some 3D points (just a few, not the full lattice):

pts = {{"E", "D", "H"}, {"E", "C", "I"}, {"E", "B", "J"}, {"F", "D", 
    "J"}, {"F", "C", "H"}, {"F", "B", "I"}, {"G", "D", "I"}, {"G", 
    "C", "I"}, {"G", "B", "I"}};

ListPointPlot3D[
 Callout[#[[1]], ToString[#[[2]]]] & /@ Transpose[{pts /. Flatten[converter], pts}], 
 PlotStyle -> PointSize[Large], 
 PlotRange -> {{0, Length[xs] + .5}, {0, Length[ys] + .5}, {0, Length[zs] + .5}}, 
 BoxRatios -> {1, 1, 1}, 
 Ticks -> {{#[[1]], #[[2]]} & /@ Reverse[converter[[1]], 2], 
           {#[[1]], #[[2]]} & /@ Reverse[converter[[2]], 2], 
           {#[[1]], #[[2]]} & /@ Reverse[converter[[3]], 2]}]

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks, this is what i'm looking for $\endgroup$ – Manx Nov 14 '19 at 5:21
  • $\begingroup$ Is this possible for 3D ? $\endgroup$ – Manx Nov 14 '19 at 5:23
  • 1
    $\begingroup$ @Manx see update $\endgroup$ – MelaGo Nov 14 '19 at 5:40
  • $\begingroup$ ah, Thanks a lot! $\endgroup$ – Manx Nov 14 '19 at 5:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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