Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7434

Re: remove tick labels

From Heike Gramberg <heike.gramberg@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: remove tick labels
Date 2011-12-25 11:34 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jd71o6$13e$1@smc.vnet.net> (permalink)
References <201112241209.HAA13633@smc.vnet.net>

Show all headers | View raw


The easiest way is probably to set LabelStyle->Opacity[0]. This doesn't remove the tick marks but merely hides them by setting their opacity to 0.  Since TicksStyle overrides LabelStyle, to
create a plot where only the tick marks along say the x-axes are hidden, you could do something
like

Plot[Sin[x], {x, 0, 2 Pi}, TicksStyle -> {Automatic, Opacity[1]}, LabelStyle -> Opacity[0]]

Note that setting LabelStyle affects all labels such as AxesLabel so you would need to use something like Style[label, Opacity[1]] to override the zero opacity set by LabelStyle, i.e.
Plot[Sin[x], {x, 0, 2 Pi}, LabelStyle -> Opacity[0], AxesLabel -> Map[Style[#, Opacity[1]] &, {x, Sin[x]}]]

Heike.

On 24 Dec 2011, at 13:09, markus wrote:

> Hi,
>
> is there a simple way in Mathematica to remove the tick labels from a
> plot while keeping the tick marks?
> I know that in principle one could specify all the tick mark
> positions, formatting and labels in a list as an argument to the plot
> function, but this is quite cumbersome. What I want is to let
> Mathematica create all the ticks automatically and the remove just the
> labels afterwards. I thought it should be possible by manipulating the
> output of the plot command in some way, but I haven't found out yet.
>
> Regards,
> Markus
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: remove tick labels Heike Gramberg <heike.gramberg@gmail.com> - 2011-12-25 11:34 +0000

csiph-web