Message Boards Message Boards

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

Does the order of option settings really matter in Style[ ]?

Posted 5 years ago

Hello,

I am dealing with the function Style[ ] in Mathematica. When I typed Style[2019, Green, 60] and Style[2019, 60, Green] separately, they share the results which looked the same. However, when I tested whether they are identical, the answer was False. Could someone help to explain the issue? Thanks a lot!!enter image description here

POSTED BY: Z. W.
2 Replies

It all depends on what you think of as equal! Do they look the same or do they have the same underlying code. SameQ or Equal look at the underlying code, not the visual representation. If you want to test that, you would have to Rasterize[…,”Image”] both sides of the equal sign and then check if they are equal.

POSTED BY: Sander Huisman
Posted 5 years ago

Aha I see. I applied Rasterize[Style[2019, Green, 60]] == Rasterize[Style[2019, 60, Green]] to see if the images are the same and the answer was true. Thank you so much for the kind reply!!

POSTED BY: Z. W.
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