# How to label Ticks in ListDensityPlot

I have some discrete data and want to make a density plot as

ListDensityPlot[{{1, 1, 1, 1}, {1, 2, 1, 2}, {1, 1, 3, 1}, {1, 2, 1,  4}}, Frame -> True, FrameLabel -> {"a", "b"}]


What if I want to add "t" along vertical axis as 1.0t 1.5t 2.0t, 2.5t, 3.0t, 3.5t 4.0t, where t is some constant.

• Have a look at FrameTicks and search the site for custom ticks, which should help you already, e.g. here: mathematica.stackexchange.com/q/32831/131. Nov 27, 2014 at 13:40
• Since there are so many helpful answers, I´d go for re-opening. Nov 28, 2014 at 8:29

Is this what you had in mind?

data = {{1, 1, 1, 1}, {1, 2, 1, 2}, {1, 1, 3, 1}, {1, 2, 1, 4}};

ticks = {#, ToString[# t]} & /@ Range[4]

ListDensityPlot[data, Frame -> True, FrameLabel -> {"a", "b"}, FrameTicks -> {ticks, ticks}]


• Closer to what I wanted, and I tried to modify your suggestion according to what was my target. I obtained the required things. Thanks Nov 27, 2014 at 11:01
• @zenith The site might get better answers if you wait a little longer to accept. Often 24 hours are suggested. Some people skip questions with accepted answers. Nov 27, 2014 at 13:26
• alright, i may wait then 24 hours Nov 27, 2014 at 15:06

You mean like this:

t = Pi/2;
ListDensityPlot[{{1, 1, 1, 1}, {1, 2, 1, 2}, {1, 1, 3, 1}, {1, 2, 1,
4}},
Frame -> True,
FrameLabel -> {"a", "b"},
FrameTicks -> {{{0, t, 2 t, 3 t}, None}, {{0, t, 2 t, 3 t}, None}}
]


or like this :

ListDensityPlot[{{1,1,1,1},{1,2,1,2},{1,1,3,1},{1,2,1,4}},
Frame->True,
FrameLabel->{"a","b"},
FrameTicks->
{{{{0,"Null"},{t,"t"},{2t,"2 t"},{3t,"3 t"}},None},
{{{0,"Null"},{t,"t"},{2t,"2 t"},{3t,"3 t"}},None}}
]


This was what I wanted

  data = {{1, 1, 1, 1}, {1, 2, 1, 2}, {1, 1, 3, 1}, {1, 2, 1, 4}};

ticks = {{1, "t"}, {2, "2 t"}, {3, "3 t"}, {4, "4 t"}}

ListDensityPlot[data, Frame -> True, FrameLabel -> {"a", "b"},  FrameTicks -> {{ticks, None}, {Automatic, None}}]