Skip to main content
9 events
when toggle format what by license comment
May 13, 2020 at 16:37 history edited MarcoB CC BY-SA 4.0
Added explanation for pattern
May 13, 2020 at 16:34 comment added MarcoB @K7PEH Yes, that's correct. The reason we need that is to avoid making the same change to the angular ticks, which otherwise would also become e.g. 30 Degree - 80. Since 30º is really represented internally as Times[30, Degree], that expression has head Times to Mathematica's eyes, and is not a real number (i.e. something with head Real). I've added the same to the answer.
May 13, 2020 at 16:29 comment added K7PEH OK, thanks for the description of SequenceForm. I will experiment a bit today. So, I also figured out the reason for value_Real pattern as it gives an identifier name to the matched item (real number). I had never used that before.
May 13, 2020 at 16:17 comment added MarcoB @K7PEH The output of InputForm is normally formatted as text and does not allow the usual context-aware selection (e.g. keep clicking with the mouse to expand selection in a syntax aware fashion). SequenceForm makes the output more easily editable. Row does not work as well for this; Text is an acceptable but inferior substitute.
May 13, 2020 at 16:11 comment added K7PEH I noted that in my version of Mathematica (should be the most recent) the function SequenceForm is obsolete and no longer exists. It is to be replaced with Row or Text. I am not sure how this SequenceForm adds to the description of the InputForm so not sure how Row or Text would be used as a substitute.
May 13, 2020 at 16:09 comment added K7PEH So, I did the same hack on my plot and it worked. Now, I need to figure out how it worked. I understand the rule substitution but I do not understand the reason it works. For example, Text[Style[value_Real,{}],opts__] is a pattern match but I would not have been able to come up with that pattern myself. I figure value_Real matches any real value but I have never seen that before "the value part". Also, why the opts__ ? Does this match any options to be used in the substitution (my guess).
May 13, 2020 at 15:20 comment added MarcoB @M.R. It sure should be (indeed that was my first attempt), but I was unable to make Ticks work here, hence the hack,
May 13, 2020 at 14:26 comment added M.R. A bit of a hack, this should be supported through a Ticks option no?
May 13, 2020 at 3:09 history answered MarcoB CC BY-SA 4.0