The ChartLabels option doesn't seem to be compatible with ListLinePlot. Do you guys have any other suggestions, or possibly a way of hacking this with AxesLabel?
ListLinePlot[Prime[Range[12]],Filling->Axis,Ticks->{{#,DateString[{1,#},"MonthNameShort"]}&/@Range[1,12],Automatic}]
- Jaebum
(* Adapting the documented ListLinePlot example *)
Print[ListLinePlot[Prime[Range[16]], Filling -> Axis]];
x = Range[16];
y = Prime[x];
x2 = {2010, #, 1} & /@ x;
Print[DateListPlot[Transpose[{x2, y}],
Joined -> True, Filling -> Axis,
DateTicksFormat -> "MonthNameShort"]];
no hack. Just create your ticks or use a tick-function.
data = Table[{i, RandomReal[]}, {i, 1, 12}];
ticks[min_, max_] :=
Table[{i,
Rotate[#, Pi/2] &@
Style[DateString[DateList[{1990, i, 1, 0, 0, 0}], "MonthName"],
Blue,
FontFamily -> "Helvetica"]}, {i, Floor[min], Ceiling[max]}];
ListLinePlot[data, Ticks -> {ticks, Automatic}]
Cheers
Patrick
PS: and AxesLabel is something different.
data=2 Range[12];
months={"January","February","March","April","May","June","July","August","September","October","November","December"};
tks=Transpose@{Range[12],Rotate[#,Pi/4]&/@months};
ListLinePlot[data,Ticks->{tks,Automatic}];
Tomas
> Date: Fri, 29 Jan 2010 07:48:29 -0500
> From: efo...@armus.com
> Subject: ListLinePlot Labels
> To: math...@smc.vnet.net
>
> I'm trying to create a ListLinePlot with custom labels on the x-axis, i.e. "January, February..." instead of "1, 2..."
(* Adapting the documented ListLinePLot example *)
ListLinePlot[Prime[Range[16]], Filling -> Axis, Frame -> True,
FrameTicks -> {{{1, "Jan"}, {4, "Feb"}, {7, "Mar"}, {10, "Apr"},
{13, "May"}, {16, "Jun"}}, Automatic, None, None}]
DateListPlot[data, {2009, 1},
Joined -> True]
ListLinePlot[data,
Frame -> True,
Axes -> False,
PlotRange -> {{.8, 12.2}, All},
FrameTicks -> {
{Automatic, Automatic},
{Join[{#, ""} & /@ Range[12], {{1, "Jan"}, {4, "Apr"},
{7, "Jul"}, {10, "Oct"}}],
{#, ""} & /@ Range[12]}},
GridLines -> {{#, GrayLevel[.85]} & /@ Range[4, 10, 3], None}]
Bob Hanlon
---- Eddie Fonner <efo...@armus.com> wrote:
=============
I'm trying to create a ListLinePlot with custom labels on the x-axis, i.e. "January, February..." instead of "1, 2..."
The ChartLabels option doesn't seem to be compatible with ListLinePlot. Do you guys have any other suggestions, or possibly a way of hacking this with AxesLabel?
--
Bob Hanlon