Group Abstract Group Abstract

Message Boards Message Boards

0
|
277K Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

[?] Get dynamic image with different color for each option?

Posted 8 years ago
Attachments:
POSTED BY: Wu Falchion

Hello Wu,

Plot has the attribute HoldAll, so you have to make sure that any necessary evaluation inside gets done, using Evaluate[]:

f = {1, x, x^2, x^3}
Panel[Column[{Row[{CheckboxBar[
      Dynamic[list1], # -> f[[#]] & /@ Range[4]], Dynamic[list1]}], 
   Dynamic[Plot[Evaluate@f[[list1]], {x, 0, 1.5}, 
     PlotStyle -> {Red, Blue, Green, Black}, ImageSize -> 500, 
     AxesStyle -> Thick]]}]]

Regards -- Henrik

POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard