These aren't questions, but (not necessarily good) feature requests, the devs are welcome to discuss them if they'd like:
- A builtin for converting
Labeled
and Legended
(and similar) expressions to true Graphics
objects, its frustrating that almost all visual things can be converted to Graphics
.
- Some sort of Visualization Tools that would allow you to make quick changes to a plot without having to reexecute the (often expensive code). Bonus points if it can export the code that would result in those changes to the plot (ie if you add a
y-axis
label to the vertical axis of a plot produced with Plot[x^2, {x, -1, 1}]
it would export Plot[x^2, {x, -1, 1}, Frame -> True, FrameLabel -> {{"one", ""}, {"", ""}}]
).
- Make
ResourceFunction["InteractiveGraphics"]
a builtin. Bonus: just export to an external viewer that can handle larger amounts of data faster.
- An explicit option in
Plot
and all other plotting functions to make text scale with the size of the plot, make this
Plot[x^2, {x, -1, 1}, Frame -> True,
FrameLabel ->
Map[Text[Style[#, FontSize -> Scaled[0.05]]] &, {{"left",
"right"}, {"bottom", "top"}}, {2}]]
be doable with just
Plot[x^2, {x, -1, 1}, Frame -> True,
FrameLabel -> {{"left", "right"}, {"bottom", "top"}},
TextScaling -> True]
Similarly for the tick labels* and even any text included as an inset or something. I think the general expectation when working with an SVG like format is that the text will act like any other law abiding member of the image and scale proportionally to the image size, I'm kinda surprised MMA doesn't do this by default.
I have some friends who use Matlab and its kinda hard to argue MMA's graces when it can't do 2 and 3 out of the box and is slow for thousands of data points.
- Heres code that accomplishes this
autolabel[newstyle_] := Module[{framelabel},
framelabel[{x0_, label : Except[_Spacer], {plen_, mlen_}, style_}] := {x0, newstyle[label], {plen, mlen}, style};
framelabel[{x0_, label : Except[_Spacer], {plen_, mlen_}}] := {x0, newstyle[label], {plen, mlen}};
framelabel[tick_] := tick;
framelabel /@ Charting`ScaledTicks[{Identity, Identity}][#1, #2, {5, 5}]&
];
style[size_] := Text[Style[#1, Black, FontFamily -> "Arial", FontSize -> Scaled[size]]] &;
axisLabelStyle = style[0.03];
tickLabelStyle = style[0.03];
Plot[x^2, {x, -1, 1}, Frame -> True,
FrameTicks -> {{autolabel[style[0.03]], True}, {autolabel[style[0.03]], True}}]
While I'm at it I'll mention the docs for FrameTicks
doesn't mention in the Details section that FrameTicks
can accept a function as it does in the Generalizations and Extensions section.