I know there are many ways even some good packages available, but I find these methods are mostly too complex for me.
So, what's a simple quick way to make ticks of a 3D plot (actually, a plot generated by RegionPlot3D
) longer?
I don't care about code effiency.
Thanks! :)
You can control the tick lengths in the Ticks option. E.g. Here they are set to 0.06 in one direction:
ticks = {#, #, {0, 0.06}} & /@ (Range[11] - 6);
RegionPlot3D[x y z < 1, {x, -5, 5}, {y, -5, 5}, {z, -5, 5},
PlotStyle -> Directive[Yellow, Opacity[0.5]], Mesh -> None,
Ticks -> Table[ticks, {3}], AxesEdge -> {{-1, -1}, None, None}]
You may use a function for Ticks
. This particular function comes from the Ticks
documentation, (Click on Generalizations and Extensions.)
ticks[min_, max_] := Table[If[EvenQ[i], {i, i, .06, Red}, {i, i, .02, Blue}],
{i, Ceiling[min], Floor[max], 1}]
Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, Ticks -> ticks]
You could use a variation of it to distinguish major and minor ticks (e.g. Integer values and tenths. This function is also straight out of the documentation (Under Applications).
ticks[min_, max_] :=
Join[Table[{i, Style[i, 12], {.04, 0}}, {i, Ceiling[min],
Floor[max]}],
Table[{j + .5, , {.02, 0}}, {j, Round[min], Round[max - 1], 1}]]
Sorry, I couldn't resist:
tick = Import["http://www.salamatvet.com/images/tick-1.jpg"];
Plot[ Sin[x], {x, 0, 10}, Method -> {"AxesInFront" -> False},
Ticks -> {Table[{i, Labeled[i, Image[tick, ImageSize -> 30]]},
{i, 2, 10, 2}]}]
A tick is a tick, is a tick ...
Thanks to Alexey for the AxesInFront
suggestion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With