This is I use MAXPLOT painting figure, the X axis and Y axis no decimal, but the mouse move on the diagram but a decimal, this how to ban?
The source code
# coding: utf-8
The import numpy as np
The import matplotlib. Pyplot as PLT
# generate data
The import time
The from matplotlib import ticker
Ka=np. Full ((500), 100);
# print (ka)
For I in range (0500) :
Print (" start: ka [" + STR (I) + "]="+ STR (ka) [I])
For j in range (0100) :
Nano_time=time. Monotonic_ns ()
# print (" nano_time="+ STR (nano_time))
Target_index=nano_time % 500;
# print (" target_index="+ STR (target_index))
Ka [target_index] +=1;
Ka [I] -=1;
PLT. RcParams [' font. Sans-serif]=[' SimHei] # used to display Chinese label normal
PLT. RcParams [' axes. Unicode_minus]=False # is used to display normal minus
PLT. Title (', 500, to 100 yuan per person, one yuan each distributed randomly 10000 times to others, how much money is 500 people per ')
PLT. Xlabel (' personnel ')
PLT. Ylabel (' balance ')
Xa=np. Arange (0500, 1)
Print (xa)
PLT. Ticklabel_format (useOffset=False)
PLT. The plot (ka)
PLT. The show ()
CodePudding user response:
Top, please inform ~ didn't get onlineCodePudding user response:
Help see not