0

I convert data(text file) into image using plt.imshow

a = np.loadtxt('C:/Users/user/Desktop/2-0.txt')
plt.imshow(a, cmap='hot', interpolation='nearest', norm=LogNorm())
plt.colorbar()
plt.show()

It is resulted from simulation, and my simulation structure has 200x200 data set, so after I get my image from data, I can get image like below. [1] [1]: https://i.stack.imgur.com/QzK2D.png

I'd like to change 0~200 values of axis to any number I want.

For example, I want to change those number of axis(0,25,50,75,100,125,150,175,200) to (0,10,20,30,40,50,60,70,80,90,100).

I can find other question that explains how I can set number of ticks, but I want to set the range of number-0~200 to 0~100.

How can I change the values? Thank you.

Jay
  • 1
  • 2
  • Does this answer your question? [Matplotlib x-axis values change its values](https://stackoverflow.com/questions/62473380/matplotlib-x-axis-values-change-its-values) – Azhar Khan Sep 05 '22 at 04:23
  • The question is similar to mine, but slightly different. In the link, I could understand how I can set numbers of ticks in the range, but I'd like to change the range of numbers. As I mentioned, I'd like to change number 0~200 to 0~100. – Jay Sep 05 '22 at 06:29

0 Answers0