2
$\begingroup$
homoLumoLines[homoY_] := 
 Graphics[{(*HOMO直线*){Thick, 
    Line[{{0, homoY}, {2, homoY}}]},(*LUMO指向HOMO的箭头*){Thick, 
    Arrowheads[0.1], Arrow[{{1, 0}, {1, homoY}}]},(*LUMO直线*){Thick, 
    Line[{{0, 0}, {2, 0}}]}}, ImageSize -> {200, 100}]

(*创建包含HOMO和LUMO文字的Graphics对象*)
homoLumoText := 
 Graphics[{(*HOMO文字*){Text[
     Style["HOMO", FontSize -> 14], {0, 1}]},(*LUMO文字*){Text[
     Style["LUMO", FontSize -> 14], {0, 0}]}}, ImageSize -> {50, 100}]

(*假设的3D图形*)
s0HomoGra3D := 
 Graphics3D[{Sphere[{0, 0, 0}, 1]}, ImageSize -> {200, 100}]
s0LumoGra3D := Graphics3D[{Cuboid[]}, ImageSize -> {200, 100}]

(*使用Row和Column组合所有图形*)
Row[{homoLumoText, 
  Column[{s0HomoGra3D, homoLumoLines[1], s0LumoGra3D}, Spacings -> 0]}]

enter image description here

I created this image, but it is not what I wanted; I want the following effect.

enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$
homoLumoLines[homoY_] := 
 Graphics[{(*HOMO*){Thick, Line[{{0, homoY}, {2, homoY}}], 
    Text[Style["HOMO", FontSize -> 12], {2.5, 
      0.95 homoY}]},(*LUMOHOMO*){Thick, Arrowheads[0.1], 
    Arrow[{{1, 0}, {1, homoY}}]},(*LUMO*){Thick, 
    Line[{{0, 0}, {2, 0}}], 
    Text[Style["LUMO", FontSize -> 12], {2.5, 0.05}]}}, 
  ImageSize -> {200, 100}, PlotRange -> {{-1, 3}, {-0.2, 1.2 homoY}}]
homoLumoLines[1]

s0HomoGra3D = 
  Graphics3D[{Sphere[{0, 0, 0}, 1]}, ImageSize -> {200, 100}];
s0LumoGra3D = Graphics3D[{Cuboid[]}, ImageSize -> {200, 100}];


GP = GraphicsColumn[{s0HomoGra3D, homoLumoLines[1], s0LumoGra3D}, 
  Spacings -> 0]

![enter image description here

To get the green boxes

 homoLumoLines[homoY_] := 
 Graphics[{(*HOMO*){{Thick, Line[{{0, homoY}, {2, homoY}}], 
     Text[Style["HOMO", FontSize -> 14, Bold], {-0.3, 
       0.99 homoY}]},(*LUMOHOMO*){Thick, Arrowheads[0.05], 
     Arrow[{{1, 0}, {1, homoY}}]},(*LUMO*){Thick, 
     Line[{{0, 0}, {2, 0}}], 
     Text[Style["LUMO", FontSize -> 14, Bold], {-0.3, 
       0.01}]}}, {EdgeForm[Directive[Green, Thick]], FaceForm[None], 
    Rectangle[{-0.6, -0.1}, {2.8, 0.1 homoY}], 
    Rectangle[{-0.6, 0.9 homoY}, {2.8, 1.1 homoY}]}}, 
  ImageSize -> 500, PlotRange -> {{-1, 3}, {-0.2, 1.2 homoY}}]
homoLumoLines[1]

enter image description here

I am unable to add the red box.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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