Timeline for Clarify when to use Style vs Directive vs List
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 31, 2019 at 18:23 | answer | added | m_goldberg | timeline score: 1 | |
| Dec 31, 2019 at 17:23 | history | edited | m_goldberg | edited tags | |
| May 14, 2017 at 3:17 | comment | added | Michael E2 | Something you can do with Style: Graphics[Style[{Circle[], Rectangle[], Point[{0.5, 0.5}]}, "foo"]], where "foo" is a style you have defined in your stylesheet. It can automatically style most graphics primitives in a consistent way (other than Circle[] for some reason -- an oversight???). | |
| May 14, 2017 at 2:54 | comment | added | Michael E2 | Works: style = Directive[Red, Thick]; Graphics[{style, Circle[]}]. Does not work: style = {Red, Thick}; Graphics[{style, Circle[]}]. Directive was introduced to address this programming problem, imo. -- Note your Style version is converted to Graphics[{{RGBColor[1, 0, 0], Thickness[Large], Circle[{0, 0}]}, {RGBColor[0, 0, 1], Rectangle[{0, 0}]}}], i.e., your first form, in the output in the front end. | |
| May 13, 2017 at 21:55 | history | edited | Joe | CC BY-SA 3.0 | Clarification of summary of the linked Directive Q&A as per comment. |
| May 12, 2017 at 9:40 | history | tweeted | twitter.com/StackMma/status/862965575806578689 | ||
| May 12, 2017 at 9:28 | comment | added | Szabolcs | Works: Graphics[{GrayLevel[Log[2]], Disk[]}] Does not work: Graphics[{Style[Disk[], GrayLevel[Log[2]]]}] | |
| May 12, 2017 at 8:04 | comment | added | jjc385 | "This question regarding the requirement for the use of Directive indicates that aside from a some small edge cases, it is mostly preferred as easier to read" -- You're saying what exactly is mostly preferred? Using Directive? Using a sequence of directives instead? Something else? | |
| May 12, 2017 at 6:33 | comment | added | Mr.Wizard | Related: (135062) | |
| May 12, 2017 at 3:52 | history | asked | Joe | CC BY-SA 3.0 |