
Data tips rounding above 10000
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Steven
el 30 de Jul. de 2020
Comentada: Steven
el 31 de Jul. de 2020
Is this intended behavior?
When using histogram to plot the count of categories in a categorical array, the data tips for the bars whose values are above 10000 are rounded to the 10s digit (e.g. 10005 is rounded to 10010). This undocumented behavior gives the impression that extra data are included or data are missing.
cats = categorical();
for count = 9985:10:10015
cats = [cats; repmat(categorical(count), count, 1)];
end
h = histogram(cats, 'DisplayOrder', 'descend')
I've checked that the source of data for the data tip contains the correct values. To correct the data tips, I need to change the data tip template format from 'auto' to '%i' using h.DataTipTemplate.DataTipRows(1).Format = '%i'.
It seems like this behavior (auto format rounding data tips to the nearest 10s above 10000) is either a bug or an undocumented feature. Is this intended behavior?
Using: MATLAB Version: 9.8.0.1417392 (R2020a) Update 4
5 comentarios
Adam Danz
el 30 de Jul. de 2020
Editada: Adam Danz
el 30 de Jul. de 2020
The screenshot I shared was from Matlab Online.
_______________________________
MATLAB Version: 9.8.0.1417392 (R2020a) Update 4
MATLAB License Number:
Operating System: Linux 4.14.177-0414177-generic #202004250428 SMP Sat Apr 25 04:31:46 UTC 2020 x86_64
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
_______________________________
We're using the same version but different operating systems.
Respuesta aceptada
Cris LaPierre
el 30 de Jul. de 2020
4 comentarios
Adam Danz
el 31 de Jul. de 2020
Well, that's weird. I just checked again, using Matlab online, and got the same result you described. Yet, my screen shot from 7 hours ago showed a successful result with the same code and OS.
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

