Message Boards Message Boards

0
|
5065 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Set up Tooltip in filling area?

Posted 8 years ago

Hi All,

Does anyone know why tooltip is not working in filling (shadow) area?

Tooltip nr. 3, 7, 8, 9, 16 and 17 are not working?

See file attached !

Thanks for your support,......Jos

data = {{1, 96}, {2, 88}, {3, 73}, {4, 68}, {5, 65}, {6, 64}, {7, 
    63}, {8, 62}, {9, 60}, {10, 56}, {11, 55}, {12, 55}, {13, 
    55}, {14, 58}, {15, 65}, {16, 71}, {17, 72}, {18, 70}, {19, 
    66}, {20, 76}};
p1 = ListPlot[Tooltip[data]
   , PlotStyle -> Blue
   , PlotLabel -> "Title"
   , PlotRange -> {Automatic, {50, 100}}
   , FrameLabel -> {"X-axis", "Y-axis"}
   , Frame -> True
   , Filling -> Bottom
   , ImageSize -> Medium
   ];
fitLine = Fit[data, {1, x}, x]
fitQuadratic = Fit[data, {1, x, x^2}, x]
p2 = Plot[fitQuadratic, {x, 0, 20},
   Epilog -> Point[data]];
p3 = Show[
  p1
  , Plot[{fitLine, fitQuadratic}, {x, 0, 20}
   , Filling -> True]
  , ImageSize -> Medium
  ]
p3 = Show[
  p1
  , Plot[{fitLine, fitQuadratic}, {x, 0, 20}
   , Filling -> True]
  , ImageSize -> Medium
  ]

Tooltip

Attachments:
POSTED BY: Jos Klaps
4 Replies

Reverse the order of the plots in Show, the plot with tooltips must be one top.

Show[Plot[{fitLine, fitQuadratic}, {x, 0, 20}, Filling -> True], p1, ImageSize -> Medium]

POSTED BY: John McGee

Hi John,

Thanks for your excellent support !

Regards,.......Jos

POSTED BY: Jos Klaps

Hi I van Veen,

Thanks for your quick reply and support.

Tooltip is working in plot (p1), but is still not visible in line with filling of plot (p3). Find updated file attached.

p1 = ListPlot[Map[Tooltip, data]
   , PlotStyle -> Blue
   , PlotLabel -> "Title"
   , PlotRange -> {Automatic, {50, 100}}
   , FrameLabel -> {"X-axis", "Y-axis"}
   , Frame -> True
   , Filling -> Bottom
   , ImageSize -> Medium
   ];
p3 = Show[
  p1
  , Plot[{fitLine, fitQuadratic}, {x, 0, 20}
   , Filling -> True]
  , ImageSize -> Medium
  ]

Image

Attachments:
POSTED BY: Jos Klaps

Hi Jos, Try

Map[Tooltip, data]

That works!

POSTED BY: l van Veen
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