Flipping y-tick labes or x-tick labels simply - Mathematica Stack Exchange most recent 30 from mathematica.stackexchange.com 2019-09-18T14:30:50Z https://mathematica.stackexchange.com/feeds/question/64898 https://creativecommons.org/licenses/by-sa/4.0/rdf https://mathematica.stackexchange.com/q/64898 5 Flipping y-tick labes or x-tick labels simply Seyhmus Güngören https://mathematica.stackexchange.com/users/4256 2014-11-04T22:52:53Z 2014-11-05T09:29:49Z <p>As it is common to most of us, when we plot a figure, x label ticks are located above x-axis and y label ticks are located at the right of y-axis. Is there any simple way to alter this in <code>Mathematica</code>? I am more interested in y-axis labels (numbers) because they overlap with the graph content. I would be happy to see them at the right side of the y-axis. Have any idea? Thanks in advance.<img src="https://i.stack.imgur.com/4dBZk.jpg" alt="enter image description here"></p> <p>Below is an example. If I move the axis origin to \$(0,0)\$, then the numbers overlap with the figure. I need to flip both the ticks and the numbers.</p> https://mathematica.stackexchange.com/questions/64898/-/64914#64914 1 Answer by kglr for Flipping y-tick labes or x-tick labels simply kglr https://mathematica.stackexchange.com/users/125 2014-11-05T01:40:37Z 2014-11-05T01:40:37Z <p>Post-processing the <code>FullGraphics</code> of <code>Plot</code> output to change the positions of ticks and tick labels of the vertical axis: </p> <pre><code>Graphics[Replace[First[FullGraphics[plt1 = Plot[Sin[x], {x, 0, 10}]]], {Text[a_, b_, {1., 0.}] :&gt; Text[Pane[a, 30, Alignment -&gt; Left], b, -{2, 0}], Line[{{0., b_ /; b != 0}, {c_, b_}}] :&gt; Line[{{0., b}, {-3 c, b}}]}, {0, Infinity}], ImageSize -&gt; 500, plt1[][]] </code></pre> <p><img src="https://i.stack.imgur.com/ElA9u.png" alt="enter image description here"></p> https://mathematica.stackexchange.com/questions/64898/-/64928#64928 1 Answer by Alexei Boulbitch for Flipping y-tick labes or x-tick labels simply Alexei Boulbitch https://mathematica.stackexchange.com/users/788 2014-11-05T09:17:30Z 2014-11-05T09:29:49Z <p>Well, if the elegant method of kguler does not work in Mma 10, one can draw everything "by hand":</p> <pre><code> lst1 = Join[Table[Line[{{-0.05, 0.1 i}, {0, 0.1 i}}], {i, -10, 10, 1}], Table[Line[{{-0.08, 0.5 i}, {0, 0.5 i}}], {i, -2, 2, 1}]]; lst2 = Table[Text[Style[0.5 i, 12, Italic], {-0.3, 0.5 i}], {i, -2, 2, 1}]; lst3 = Table[Line[{{\[Pi]*i/2, -0.05}, {\[Pi]*i/2, 0}}], {i, 1, 4, 1}]; lst4 = Table[Text[Style[\[Pi]*i/2, 12, Italic], {\[Pi]*i/2, -0.3}], {i, 1, 4,1}]; Show[{ Plot[Sin[x], {x, 0, 2 \[Pi]}, Ticks -&gt; None, PlotRange -&gt; {{-0.5, 2 \[Pi]+0.5}, Automatic}], Graphics[{lst1, lst3}], Graphics[{lst2, lst4}] }] </code></pre> <p>yielding this: <img src="https://i.stack.imgur.com/qKKX3.jpg" alt="enter image description here"></p> <p>Have fun!</p>