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


Groups > comp.soft-sys.math.mathematica > #7429 > unrolled thread

remove tick labels

Started bymarkus <markusg.phys@googlemail.com>
First post2011-12-24 12:10 +0000
Last post2011-12-25 11:35 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  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

#7429 — remove tick labels

Frommarkus <markusg.phys@googlemail.com>
Date2011-12-24 12:10 +0000
Subjectremove tick labels
Message-ID<jd4fgc$db6$1@smc.vnet.net>
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

[toc] | [next] | [standalone]


#7431

From"Nasser M. Abbasi" <nma@12000.org>
Date2011-12-25 11:35 +0000
Message-ID<jd71q3$149$1@smc.vnet.net>
In reply to#7429
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web