xlabel missing in plot

xlabel missing in plot

by Martin Kraska -
Number of replies: 3

Hello,

in a STACK question I am using the plot() function for general feedback.

Yet I don't manage to display an x axis label using the  [xlabel, "text"] object. According to the github documentation xlabel should be supported.

Please find the question in the attachment.

Thanks for any hint.

Martin

Attachment 2020-05-08 21_07_30-STACK-Frage bearbeiten.png
Average of ratings: -
In reply to Martin Kraska

Re: xlabel missing in plot

by Christopher Sangwin -
Picture of Plugin developers

Ok, I've had a quick look with these minimal examples.

Q:[discrete,0,0],[0,2/5],[3,2/5],[5,-(8/5)];
M:if x < 3 then (2*x)/5 else (8*(5-x))/5-(5-x)^2/2;

and castext

{@plot( [Q, M], [x,0,5], [xlabel,"x/a"], grid2d,[legend, "F_Q/(q_0 a)", "M/(q_0 a^2)"],[y,-2.1,1.78],[box,false],[axes,solid])@}
{@plot(x^2,[x,-3,3],[y,-3,10],[xlabel,"This is x squared"])@}

The second plot does have the x-label plot in STACK, but your plot does not produce the x-label in desktop Maxima!  So, I think this is a "Maxima thing" rather than a "STACK thing" (!).  Sorry not to be more helpful, but could have a look at this issue using desktop Maxima? If you need a bug fix, let me know and I'll help.



Attachment Screenshot - 090520 - 101526.png
Attachment Screenshot - 090520 - 102232.png
In reply to Christopher Sangwin

Re: xlabel missing in plot

by Christopher Sangwin -
Picture of Plugin developers
Or, I could mess around myself!

I think the culprit is the option. [box,false], which stops the printing of the x-axis label. I think you will have to dig about in Maxima/GNUplot if you want [box,false], and the x-axis label. Pull request gratefully anticipated... ! wink

{@plot( [Q, M], [x,0,5], [xlabel,"x/a"], grid2d,[legend, "F_Q/(q_0 a)", "M/(q_0 a^2)"],[y,-2.1,1.78],[axes,solid])@}
In reply to Christopher Sangwin

Re: xlabel missing in plot

by Martin Kraska -

Thank you for the hint. Lookup in the Maxima docs confirms that unboxed plots ignore axis labels.

After messing around with smart placement of [label, ["text", x,y]] I gave up and ended up with completely abandoning annotations in the graph, because iterative adjustment for random plots isn't something which I want to go through every time when I make such a plot.

Instead I put a text line with explanations above the plot. This gives me a level of control which plot() never will.

Martin


Attachment 2020-05-10 14_10_57-HA_09_ Überprüfung des Testversuchs.png