# How I can rotate the x-axis FrameTicks?

I don´t have idea how to make them rotate. Can anybody help me?

• Why not post the data and the code in a format people can easily copy? People are less likely to help you if you do not make it easy for them to try things out. Oct 5, 2016 at 7:14
• You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. It is recommended that you browse the Markdown help and How to copy code from Mathematica so it looks good on this site. Once read the edit window help button ? gives quick reminders of that material. To remove from the screen, click ? again. Oct 5, 2016 at 16:18

I made up some data to emulate datos8 and datos9.

datos8 = {{1, 0}, {2, 10}, {3, 40}, {4, 110}, {5, 15}, {6, 4.5}, {7,
73.6}, {8, 20.5}, {9, 212}, {10, 57.5}, {11, 46.8}, {12, 32}, {13,
8}, {14, 181.5}, {15, 118}, {16, 35}, {17, 106}, {18, 81}, {19,
48.5}, {20, 14}};

datos9 = {{1, 4.5}, {2, 10}, {3, 30}, {4, 78}, {5, 10}, {6, 10}, {7,
26}, {8, 26}, {9, 75}, {10, 75}, {11, 20}, {12, 20}, {13, 20}, {14,
67}, {15, 67}, {16, 67}, {17, 67}, {18, 54}, {19, 54}, {20, 54}};


Below is your plot in the current state:

ListLinePlot[
{datos8, datos9},
PlotRange -> {{1, 20}, {0, 250}},
PlotLegends -> Placed[{"Determinante", "Traza"}, Right],
PlotStyle -> {
{Blue, Thickness[0.002]},
{Green, Thickness[0.002]}
},
PlotMarkers -> Automatic,
Frame -> True,
FrameLabel -> {"Orbital atómico", "Dispersión"},
FrameTicks -> {
{
{50, 100, 150, 200, 250},
None
},
{
{
{1, "1s"}, {2, "2s"}, {3, "3s"}, {4, "4s"},
{5, "2\!$$\*SubscriptBox[\(p$$, $$s$$]\)"}, {6,
"2\!$$\*SubscriptBox[\(p$$, $$x$$]\),2\!$$\*SubscriptBox[\(p$$, \
$$y$$]\)"}, {7, "3\!$$\*SubscriptBox[\(p$$, $$s$$]\)"}, {8,
"3\!$$\*SubscriptBox[\(p$$, $$x$$]\),3\!$$\*SubscriptBox[\(p$$, \
$$y$$]\)"},
{9, "4\!$$\*SubscriptBox[\(p$$, $$z$$]\)"}, {10,
"4\!$$\*SubscriptBox[\(p$$, $$x$$]\),3\!$$\*SubscriptBox[\(p$$, \
$$y$$]\)"}, {11,
"4\!$$\*SubscriptBox[\(p$$, SuperscriptBox[$$z$$, $$2$$]]\)"}, \
{12, "3\!$$\*SubscriptBox[\(p$$, $$xz$$]\),3\!$$\*SubscriptBox[\(p$$, \
$$yz$$]\)"},
{13,
"3\!$$\*SubscriptBox[\(d$$, \
$$xy$$]\),3\!$$\*SubscriptBox[\(d$$, $$\*SuperscriptBox[\(x$$, $$2$$] \
- \*SuperscriptBox[$$y$$, $$2$$]\)]\)"}, {14,
"4\!$$\*SubscriptBox[\(d$$, SuperscriptBox[$$z$$, $$2$$]]\)"}, \
{15, "4\!$$\*SubscriptBox[\(d$$, $$xz$$]\),4\!$$\*SubscriptBox[\(d$$, \
$$yz$$]\)"}, {16,
"4\!$$\*SubscriptBox[\(d$$, \
$$xy$$]\),4\!$$\*SubscriptBox[\(d$$, $$\*SuperscriptBox[\(x$$, $$2$$] \
- \*SuperscriptBox[$$y$$, $$2$$]\)]\)"},
{17,
"4\!$$\*SubscriptBox[\(f$$, SuperscriptBox[$$z$$, $$3$$]]\)"}, \
{18, "4\!$$\*SubscriptBox[\(f$$, SuperscriptBox[$$xz$$, $$2$$]]\),4\!\
$$\*SubscriptBox[\(f$$, SuperscriptBox[$$yz$$, $$2$$]]\)"}, {19,
"4\!$$\*SubscriptBox[\(f$$, \
$$xyz$$]\),4\!$$\*SubscriptBox[\(f$$, $$z \((\*SuperscriptBox[\(x$$, \
$$2$$] - \*SuperscriptBox[$$y$$, $$2$$])\)\)]\)"}, {20,
"4\!$$\*SubscriptBox[\(f$$, $$x \((\*SuperscriptBox[\(x$$, \
$$2$$] - 3 \*SuperscriptBox[$$y$$, \
$$3$$])\)\)]\),4\!$$\*SubscriptBox[\(f$$, $$y \((3 \ \*SuperscriptBox[\(x$$, $$2$$] - \*SuperscriptBox[$$y$$, $$2$$])\)\)]\
\)"}
},
None
}
},
ImageSize -> 500
]


There may very well be an easier way but one method that works it to extract the x-axes frame ticks from the plot and use Map to wrap Rotate the strings.

ticks = Map[{#[[1]], Rotate[#[[2]], π/2]} &, {
{1, "1s"}, {2, "2s"}, {3, "3s"}, {4, "4s"},
{5, "2\!$$\*SubscriptBox[\(p$$, $$s$$]\)"}, {6,
"2\!$$\*SubscriptBox[\(p$$, $$x$$]\),2\!$$\*SubscriptBox[\(p$$, \
$$y$$]\)"}, {7, "3\!$$\*SubscriptBox[\(p$$, $$s$$]\)"}, {8,
"3\!$$\*SubscriptBox[\(p$$, $$x$$]\),3\!$$\*SubscriptBox[\(p$$, \
$$y$$]\)"},
{9, "4\!$$\*SubscriptBox[\(p$$, $$z$$]\)"}, {10,
"4\!$$\*SubscriptBox[\(p$$, $$x$$]\),3\!$$\*SubscriptBox[\(p$$, \
$$y$$]\)"}, {11,
"4\!$$\*SubscriptBox[\(p$$, SuperscriptBox[$$z$$, $$2$$]]\)"}, \
{12, "3\!$$\*SubscriptBox[\(p$$, $$xz$$]\),3\!$$\*SubscriptBox[\(p$$, \
$$yz$$]\)"},
{13, "3\!$$\*SubscriptBox[\(d$$, \
$$xy$$]\),3\!$$\*SubscriptBox[\(d$$, $$\*SuperscriptBox[\(x$$, $$2$$] \
- \*SuperscriptBox[$$y$$, $$2$$]\)]\)"}, {14,
"4\!$$\*SubscriptBox[\(d$$, SuperscriptBox[$$z$$, $$2$$]]\)"}, \
{15, "4\!$$\*SubscriptBox[\(d$$, $$xz$$]\),4\!$$\*SubscriptBox[\(d$$, \
$$yz$$]\)"}, {16,
"4\!$$\*SubscriptBox[\(d$$, $$xy$$]\),4\!$$\*SubscriptBox[\(d$$, \
$$\*SuperscriptBox[\(x$$, $$2$$] - \*SuperscriptBox[$$y$$, \
$$2$$]\)]\)"},
{17, "4\!$$\*SubscriptBox[\(f$$, SuperscriptBox[$$z$$, \
$$3$$]]\)"}, {18,
"4\!$$\*SubscriptBox[\(f$$, SuperscriptBox[$$xz$$, $$2$$]]\),4\!\
$$\*SubscriptBox[\(f$$, SuperscriptBox[$$yz$$, $$2$$]]\)"}, {19,
"4\!$$\*SubscriptBox[\(f$$, \
$$xyz$$]\),4\!$$\*SubscriptBox[\(f$$, $$z \((\*SuperscriptBox[\(x$$, \
$$2$$] - \*SuperscriptBox[$$y$$, $$2$$])\)\)]\)"}, {20,
"4\!$$\*SubscriptBox[\(f$$, $$x \((\*SuperscriptBox[\(x$$, \
$$2$$] - 3 \*SuperscriptBox[$$y$$, \
$$3$$])\)\)]\),4\!$$\*SubscriptBox[\(f$$, $$y \((3 \ \*SuperscriptBox[\(x$$, $$2$$] - \*SuperscriptBox[$$y$$, $$2$$])\)\)]\
\)"}
}];


Now remake your plot using the ticks with the rotated strings

ListLinePlot[
{datos8, datos9},
PlotRange -> {{1, 20}, {0, 250}},
PlotLegends -> Placed[{"Determinante", "Traza"}, Right],
PlotStyle -> {
{Blue, Thickness[0.002]},
{Green, Thickness[0.002]}
},
PlotMarkers -> Automatic,
Frame -> True,
FrameLabel -> {"Orbital atómico", "Dispersión"},
FrameTicks -> {
{
{50, 100, 150, 200, 250},
None
},
{
ticks,
None
}
},
ImageSize -> 500
]


• Oh, thank you very much! It works. Oct 6, 2016 at 4:41