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


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

Re: remove tick labels

Started byBob Hanlon <hanlonr357@gmail.com>
First post2011-12-25 11:33 +0000
Last post2011-12-26 11:53 +0000
Articles 2 — 2 participants

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 Bob Hanlon <hanlonr357@gmail.com> - 2011-12-25 11:33 +0000
    Re: remove tick labels "Nasser M. Abbasi" <nma@12000.org> - 2011-12-26 11:53 +0000

#7432 — Re: remove tick labels

FromBob Hanlon <hanlonr357@gmail.com>
Date2011-12-25 11:33 +0000
SubjectRe: remove tick labels
Message-ID<jd71m8$12f$1@smc.vnet.net>
Show[(plt = Plot[x, {x, 0, 1}]),
 Ticks -> (Ticks /. AbsoluteOptions[plt, Ticks] /.
    {t_, t_, l_List, s_List} -> {t, "", l, s})]

Bob Hanlon

On Sat, Dec 24, 2011 at 7:09 AM, markus <markusg.phys@googlemail.com> 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
>

[toc] | [next] | [standalone]


#7435

From"Nasser M. Abbasi" <nma@12000.org>
Date2011-12-26 11:53 +0000
Message-ID<jd9n88$e2r$1@smc.vnet.net>
In reply to#7432
On 12/25/2011 5:33 AM, Bob Hanlon wrote:
> Show[(plt = Plot[x, {x, 0, 1}]),
>   Ticks ->  (Ticks /. AbsoluteOptions[plt, Ticks] /.
>      {t_, t_, l_List, s_List} ->  {t, "", l, s})]
>
> Bob Hanlon
>

I tried something like the above during my attempts, but if you notice,
the ticks on the 'modified' plot do not look the same as the
original one.

If we Compare

Plot[Sin[x], {x, -Pi, Pi}]

with what you have:

Show[(plt = Plot[Sin[x], {x, -Pi, Pi}]),
  Ticks -> (Ticks /.
      AbsoluteOptions[plt, Ticks] /. {t_, t_, l_List, s_List} -> {t,
       "", l, s})]


We notice 2 things:
1) some ticks are lost near the orgin on the x-axis
2) the y-axis ticks no longer looks like in the orginal plot.

--Nasser

[toc] | [prev] | [standalone]


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


csiph-web