필터 지우기
필터 지우기

How to set scientific notation in data tips ?

조회 수: 12 (최근 30일)
andrea
andrea 2020년 11월 8일
편집: Mario Malic 2020년 11월 9일
Hello ,
I would like to see scientific notation in the data tip on my plot , I attached an image of my plot , instead of that long number in the data tip I would like to have something like 77.5e13 is this possible ?
And also I want to change the scentific notation in the x axis, as you can see it displays 10^14 but I want it to be 10^13 .
Thank you.

채택된 답변

Mario Malic
Mario Malic 2020년 11월 9일
편집: Mario Malic 2020년 11월 9일
Hello,
x = 1:10
y = rand(1,10).*1000
h = plot(x,y)
for ii = 1 : length(x)
datatip(h, 'DataIndex', ii)
end
You can set format of each row in DataTip, by DataTipRows.Format.
dtTemplate = get(h, 'DataTipTemplate')
dtTemplate.DataTipRows(1).Format = '%e'; % adjust
dtTemplate.DataTipRows(2).Format = '%e';

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by