Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want a simple quick way to make ticks of a 3D plot longer

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! :)

like image 993
FreshApple Avatar asked Oct 01 '11 11:10

FreshApple


3 Answers

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}]

enter image description here

like image 76
Chris Degnen Avatar answered Nov 23 '22 23:11

Chris Degnen


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]

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}]]

ticks2

like image 36
DavidC Avatar answered Nov 23 '22 23:11

DavidC


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}]}]

enter image description here

A tick is a tick, is a tick ...

Thanks to Alexey for the AxesInFront suggestion.

like image 33
Dr. belisarius Avatar answered Nov 24 '22 00:11

Dr. belisarius