Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7433
| From | "David Park" <djmpark@comcast.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: remove tick labels |
| Date | 2011-12-25 11:33 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jd71n7$134$1@smc.vnet.net> (permalink) |
| References | <19351067.2302.1324726059042.JavaMail.root@m06> |
The Presentations Application has CustomTicks and NoTicksLabel commands.
The easiest method to specify plots without tick labels would be as follows:
<< Presentations`
testplot = Plot[Sin[x], {x, 0, 2 \[Pi]},
Frame -> True]
Write CustomTicks without labels and use them in the plot.
xticks = CustomTicks[Identity, {0, 7, 1, 5}] // NoTickLabels;
yticks = CustomTicks[Identity, {-1, 1, 0.5, 5}] // NoTickLabels;
Plot[Sin[x], {x, 0, 2 \[Pi]},
Frame -> True,
FrameTicks -> {xticks, yticks}]
Here the Identity in the CustomTicks command specifies that the tick
positions will be the same as the underlying coordinates. (Otherwise we
could use a function that generates custom tick marks.) The list {0, 7, 1,
5} means to make ticks from 0 to 7 in steps of 1 with 5 subdivisions for
small ticks. So you have to specify the ticks but it is not tedious.
We can try to let Mathematica automatically generate the ticks and then use
NoTickLabels to suppress the labels.
testplot = Plot[Sin[x], {x, 0, 2 \[Pi]},
Frame -> True];
specialticks =
FrameTicks /. AbsoluteOptions[testplot, FrameTicks] //
NoTickLabels;;
Show[testplot, FrameTicks -> specialticks]
This does not work properly as the length of the ticks are not the same as
in the original plot, nor are the y ticks the same!
step1=FrameTicks/. AbsoluteOptions[testplot,FrameTicks];
step1[[2]]//Column
The original plot has major y divisions spaced by 0.5, but using
AbsoluteOptions gives divisions spaced by 0.25. It is easier here to use
CustomTicks than to mess with Mathematica features.
David Park
djmpark@comcast.net
http://home.comcast.net/~djmpark/index.html
From: markus [mailto:markusg.phys@googlemail.com]
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
Re: remove tick labels "David Park" <djmpark@comcast.net> - 2011-12-25 11:33 +0000
csiph-web