0
votes

For Matlab plots, how do I place plus or minus sign as X tick labels in a Matlab plot?

Currently, I'm using these lines of code but I would like to obtain plus-minus sign (±) values preceding a numerical value on the x tick labels.

x_values = ['+/- 1';'+/- 2'];
set(gca,'XTickLabel',x_values)

1
Can you please describe how this question relates specifically to data-mining or data science ? - image_doctor
Hi image_doctor, I could not find the best "community" to ask this question so I chose Data Science because one has to use tools to perform Data Science in the first place. Would you be able to suggest other places I could post this question? That would be very helpful given that I'm new to this place. Thank you. - Raptor
@Raptor StackOverflow is the best place. - Franck Dernoncourt
Tough call on questions like this. StackExchange sites overlap at the edges, and I think this could be considered a simple programming question. Matlab is also on-topic for data science. I don't think it's wrong to post here. That said I suspect SO will get you answers faster, and there isn't one here yet. In this case I'd migrate, but not obviously off topic. - Sean Owen
Hi Sean, thank you for your help and redirection to SO! - Raptor

1 Answers

1
votes

You can insert special characters into text using TeX, or LaTex, docs here and here:

\pm is used for plus/minus