r - Splitting axis labels with expressions -



r - Splitting axis labels with expressions -

i have plot long label containing look , want split on 2 lines. adding "\n" within look result not expected.

ylabel <- expression("a long label text , \n expression"*(alpha+beta) [ij]*" long label text , expression") curve(x^3 - 3*x, -2, 2, xlab=xlabel)

any help appreciated. thanks

here solution, relying on atop did @andrest in edit. note cannot utilize command character \n in expression, explains why using expression(paste("...\n", alpha[i], "....")) not produce desired output.

xlabel <- expression(atop("a long label text , expression", paste((alpha+beta)[ij], " long label ..."))) curve(x^3 - 3*x, -2, 2, sub=xlabel, xlab="")

note used sub instead of xlab avoid collision x tick marks.

r graph axis

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -