2
$\begingroup$

Possible Duplicate:
Remove tick labels, but retain tick marks in RegionPlot (and related functions)

I need to display a 2D graph, say $y=x^2$ with tick-marks along the $x$ and $y$-axes but with no numbers (e.g. 1, 2, 3 ...) indicating these tick-mark values.

What is the most efficient way to perform this task? Thanks!

$\endgroup$

marked as duplicate by J. M. will be back soon Oct 21 '12 at 2:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4
$\begingroup$

For example:

Plot[x x, {x, 0, 1}, Ticks -> ({#, #} &@Array[{1/10 #,} &, 10])]

Mathematica graphics

$\endgroup$
  • 1
    $\begingroup$ You sure like your styled plots. $\endgroup$ – Mr.Wizard Oct 20 '12 at 19:48
  • 1
    $\begingroup$ @Mr.Wizard Yeah! Don't you? $\endgroup$ – Dr. belisarius Oct 20 '12 at 20:28
  • $\begingroup$ Wow, very fancy! I don't even know what # and &@ do, but it works! $\endgroup$ – QuantumDot Oct 20 '12 at 23:04
  • $\begingroup$ How did you make your plot stylized like that? $\endgroup$ – QuantumDot Oct 20 '12 at 23:05
  • 2
    $\begingroup$ Honestly? Torn is great but I'd rather you use the actual output of Plot not the "hand drawn" version, which I find confusing and already a little tiring. Are you glad you asked? :^) $\endgroup$ – Mr.Wizard Oct 21 '12 at 5:10
7
$\begingroup$

This isn't clever, but it works:

Plot[x^2, {x, 0, 10}, LabelStyle -> {White}]

Is that sufficient? But, I think the use of FrameTicksStyle in the link in Mr.Wizards answer is better. Alternatively, specifying your own ticks as MW says gives you more control of tick placement. It's easier to use Table to specify the ticks, though.

$\endgroup$
  • $\begingroup$ @Mr.Wizard Thanks $\endgroup$ – George Wolfe Oct 20 '12 at 19:56
2
$\begingroup$

If you are asking to preserve the Automatic ticks but remove their labels this is a duplicate of: Remove tick labels, but retain tick marks in RegionPlot (and related functions)

If you are asking to place your own ticks without labels you can simply specify an empty string "" or Spacer[0] as the tick label.

Plot[x^2, {x, 0, 5}, 
 Ticks -> {{{1, Spacer[0]}, {2, Spacer[0]}, {3, Spacer[0]}},
           {{5, Spacer[0]}, {15, Spacer[0]}, {25, Spacer[0]}}}
]

Mathematica graphics

$\endgroup$
  • 1
    $\begingroup$ Thanks for the heads up on the duplicate. $\endgroup$ – QuantumDot Oct 20 '12 at 23:05

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