Multi-line xticklabel

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Multi-line xticklabel

Laura
Hello,

I am trying to split my axis label in two, but it is not working...

How can I do that ? Here is what I have tried.

sheet = 'Final test';
AS8 = 'C5:M9';
filename = 'Results.xlsx';
data.AS8 = xlsread(filename, sheet, AS8);
figure(1)
grid on
boxplot(data.AS8);
set(gca (),'xtick',[1 2 3 4 5 6 7 8 9 10 11],'FontSize', 20,'xticklabel',{'Volume',"Accroche"; "du tricot","Epaisseur", "du tricot",'Opacité','Finesse du raccod', 'Elasticité en largeur','Elasticité en longueur','Douceur interne', 'Douceur externe', 'Epaisseur couture (Angle)', 'Epaisseur couture milieu'});
title ('Produit AS 8 (Evaluation finale)');
ylim ([0 10]);

I am trying to slit these two setence :
- Epaisseur du tricot
- Accroche du tricot"

Thanks for your help
Reply | Threaded
Open this post in threaded view
|

Re: Multi-line xticklabel

nrjank
Administrator
Laura, this message wasn't created in the help list, so I don't think anyone will see it and respond.  Can I request you create a new help request under Octave-General, or by emailing directly to help@octave.org, or over on our new help forum at https://octave.discourse.group/
Reply | Threaded
Open this post in threaded view
|

Re: Multi-line xticklabel

nrjank
Administrator
In reply to this post by Laura
I have moved your message to the Octave-help list.


Laura wrote
> Hello,
>
> I am trying to split my axis label in two, but it is not working...
>
> How can I do that ? Here is what I have tried.

>
> I am trying to slit these two setence :
> - Epaisseur du tricot
> - Accroche du tricot"
>
> Thanks for your help
<https://octave.1599824.n4.nabble.com/file/n4697918/Capture.png>





--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: Multi-line xticklabel

BGreen

On Tue, Jul 28, 2020 at 2:58 PM nrjank <[hidden email]> wrote:
I have moved your message to the Octave-help list.


Laura wrote
> Hello,
>
> I am trying to split my axis label in two, but it is not working...
>
> How can I do that ? Here is what I have tried.

>
> I am trying to slit these two setence :
> - Epaisseur du tricot
> - Accroche du tricot"
>
> Thanks for your help
<https://octave.1599824.n4.nabble.com/file/n4697918/Capture.png>

--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html

Axis label or xticklabel? The subject line and body text are asking different questions.

You should be able to do this with a newline character, \n
Try the following examples.

Axis label:

xlabel("Hi\nthere")

xticklabel:

xtl = get(gca,"xticklabel");
xtl(1,1) = "Hi\nthere";
set(gca,"xticklabel",xtl);