How to convert number format in yaxis?

7 次查看(过去 30 天)
I have a plot x-y. I would like to ask how to change the format of yaxis from arabic to roman number ? I tried to use the following function:
but it is no use.
Could you please help me?

采纳的回答

Dave B
Dave B 2021-8-27
I'm not sure what problem you had with the other submission because you didn't provide much detail about why it was no use. But I'd image the code would:
  • make the plot
  • get the values of ticks on the y axis
  • make sure that the 'mode' is manual (so that the ticks don't change). It's always wise to set the tick values explicitly or set the mode when setting tick labels, otherwise if the ticks change things will likely look weird
  • convert the values
  • set the ticklabels
plot(...)
tickvals = yticks;
yticks manual
romanvals = num2roman(tickvals);
yticklabels(romanvals);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by