Message Boards Message Boards

0
|
4841 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Adding labels to points in DateListPlot

Posted 11 years ago
Hello,
How we can adding labels to points in DateListPlot?
It seems that my code is not uploaded by the internet explorer. I will try again.

The intension is to get the data on the points from 2006 up to 2014. Example in 2006 was 32%, 2007 was 33% etc.
File nb. will be attached !

Thanks
Jos
Attachments:
POSTED BY: Jos Klaps
2 Replies
Posted 11 years ago
One of the option is to use "Tooltip" command which displays the values as you hover the mouse pointer. In your case-
 dataPlot =
  ListLinePlot[
   Tooltip[data],
   PlotRange -> {{2005, 2015}, {30, 60}},
   Ticks -> {Range[2006, 2013, 1] // Evaluate, Automatic},
   PlotStyle -> PointSize[.02],
   PlotMarkers -> {Automatic, 10},
   Frame -> True,
   GridLines -> Automatic,
  GridLinesStyle -> Directive[Black, Dotted],
  Filling -> Bottom, {FillingStyle -> Automatic},
  AxesOrigin -> {2014, 55}]
Or you can use the "Epilog" option to lable the data points as shown below:
 dataPlot =
  ListLinePlot[
   data,
   PlotRange -> {{2005, 2015}, {30, 60}},
   Ticks -> {Range[2006, 2013, 1] // Evaluate, Automatic},
   PlotStyle -> PointSize[.02],
   PlotMarkers -> {Automatic, 10},
   Frame -> True,
   GridLines -> Automatic,
  GridLinesStyle -> Directive[Black, Dotted],
  Filling -> Bottom, {FillingStyle -> Automatic},
  AxesOrigin -> {2014, 55},
  Epilog -> {Text[#[[2]], # + {0, 1.5}] & /@ data}
  ]
And the lables will be displayed like this:
POSTED BY: Girish Arabale
Hi Girish,
Many thanks for your excellent support !
Jos
POSTED BY: Jos Klaps
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract