MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Tick Labels Example

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47199] RE: [mg47185] Tick Labels Example
  • From: "David Park" <djmp at earthlink.net>
  • Date: Tue, 30 Mar 2004 04:01:52 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Terry,

If you are willing to change all the text in your plot, the easy solution
is...

Plot[x^2, {x, 0, 2},
    TextStyle -> {FontFamily -> "Helvetica", FontWeight -> "Bold",
        FontSize -> 14}];

Otherwise, you can define your own tick functions. Here I also make the y
ticks red.

xticks = Table[{x,
        StyleForm[x, FontFamily -> "Helvetica", FontWeight -> "Bold",
          FontSize -> 14]}, {x, 0, 2, 0.5}];

yticks = Table[{y,
        StyleForm[y, FontFamily -> "Helvetica", FontWeight -> "Bold",
          FontSize -> 14, FontColor -> RGBColor[1, 0, 0]]}, {y, 0, 4, 1}];

Plot[x^2, {x, 0, 2},
    Ticks -> {xticks, yticks}];

The problem with the above is that it eliminates the minor ticks and it is a
bunch of work to add them back in.

If you use DrawGraphics you can use the CustomTick function, which gives the
minor ticks and allows the labels to be specified with the CTNumberFunction
option.

Needs["DrawGraphics`DrawingMaster`"]

Draw2D[
    {Draw[x^2, {x, 0, 2}]},
    Axes -> True,
    Ticks ->
      {CustomTicks[Identity, {0, 2, 0.5, 5},
          CTNumberFunction -> (StyleForm[#, FontFamily -> "Helvetica",
                  FontWeight -> "Bold", FontSize -> 14] &)],
        CustomTicks[Identity, {0, 4, 1, 5},
          CTNumberFunction -> (StyleForm[#, FontFamily -> "Helvetica",
                  FontWeight -> "Bold", FontSize -> 14,
                  FontColor -> Red] &)]},
    ImageSize -> 350];

If you are using a Frame, then you should use FrameTicks instead of Ticks.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/



From: Terry [mailto:tharter at attglobal.net]
To: mathgroup at smc.vnet.net

Hi All,

    I'm sure its been posted here before in the past (is there a
newsgroup archive that is searchable?), but could some one post an
example of how to get the Tick Labels in  a 2D Plot  displayed  in
something other  than the  "Default" settings.  for example, change the
font size, and  the "Boldness" attribute.  Any simple example will do.
I don't need to produce any new  tick marks than what the  default
gives,   I just want them to appear more visible.   Thanks  in advance!!
....Terry




  • Prev by Date: AW: Re: Music to Mathematica
  • Next by Date: Re: Infrequent Mathematica User
  • Previous by thread: Re: Tick Labels Example
  • Next by thread: New Version of OO System