From: Eddie Fonner on 29 Jan 2010 07:48 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?
From: Jaebum Jung on 30 Jan 2010 07:11 Do you mean this? ListLinePlot[Prime[Range[12]],Filling->Axis,Ticks->{{#,DateString[{1,#},"MonthNameShort"]}&/@Range[1,12],Automatic}] - Jaebum On 1/29/10 6:48 AM, Eddie Fonner 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? > >
From: Chris Degnen on 30 Jan 2010 07:13 You could try this: (* 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"]]; > 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? >
From: Patrick Scheibe on 30 Jan 2010 07:13 Hi, 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. Am Jan 29, 2010 um 1:48 PM schrieb Eddie Fonner: > 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? >
From: Tomas Garza on 30 Jan 2010 07:13 One possibility is "hacking" this with Ticks. Full length month names will make the x-axis appear a little cluttered, but you can Rotate them to produce a more pleasant result: 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: efonner(a)armus.com > Subject: ListLinePlot Labels > To: mathgroup(a)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..." > > 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? >
|
Next
|
Last
Pages: 1 2 Prev: Intervals. Was Re: More /.{I->-1} craziness. Schools are conservative. Next: Numerical Problem |