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


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

Re: remove tick labels

From "Nasser M. Abbasi" <nma@12000.org>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: remove tick labels
Date 2011-12-25 11:35 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jd71q3$149$1@smc.vnet.net> (permalink)
References <jd4fgc$db6$1@smc.vnet.net>

Show all headers | View raw


On 12/24/2011 6:10 AM, 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
>

Well, this is the best I could do, it removes the labels, but
for some reason the y-axis ticks spacings seems look different.

May be playing more with it will fix it.

I think there should be an option to do this. I do not think
a user has to do this sort of low level stuff just to remove
tick labels.

-------------------------------------------
t = AbsoluteOptions[p, Ticks];

tx = Map[If[Head[#[[2]]] === Real, ReplacePart[#, "", {2}], #] &,
    t[[1, 2, 1]]];

ty = Map[If[Head[#[[2]]] === Real, ReplacePart[#, "", {2}], #] &,
    t[[1, 2, 2]]];

Plot[Sin[x], {x, -Pi, Pi}, Ticks -> {tx, ty}]
-------------------------------------------

For reference, I used this article for help

"This notebook illustrates how to move tick labels from the default positions.
The specific example presented here puts the labels above the horizontal axis."

http://library.wolfram.com/infocenter/TechNotes/4134/

--Nasser

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


Thread

remove tick labels markus <markusg.phys@googlemail.com> - 2011-12-24 12:10 +0000
  Re: remove tick labels "Nasser M. Abbasi" <nma@12000.org> - 2011-12-25 11:35 +0000

csiph-web