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


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

Re: remove tick labels

Started by"David Park" <djmpark@comcast.net>
First post2011-12-25 11:33 +0000
Last post2011-12-25 11:33 +0000
Articles 1 — 1 participant

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

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: remove tick labels "David Park" <djmpark@comcast.net> - 2011-12-25 11:33 +0000

#7433 — Re: remove tick labels

From"David Park" <djmpark@comcast.net>
Date2011-12-25 11:33 +0000
SubjectRe: remove tick labels
Message-ID<jd71n7$134$1@smc.vnet.net>
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

[toc] | [standalone]


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


csiph-web