Hello,

I don't know if I can ask questions concerning matplotlib problems
in this email list ... just let me know that this is not the right 
place, if.

I have an image, which I can read and put into a figure. The image
has axis and I can even save the image. I have two issues:

1. Since it is an 512 x 512 pixel image, the x and y axis labels
go from 0 to 500. However, I don't want these labels, I want to
change them to, e.g., 0 .. 3400 and 0 .. 3400. How can I do this?

2. I tried to attach a color bar to the right of the image but without
success. Have you a hint?

The code can be found below, it is a rather simple one.

Thanks in advance for any help.

Pythphys.


*****************************************************************

import scipy
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np

file_path  = "path_to_file"

# The binary file is read
data = scipy.fromfile(file=file_path,dtype=scipy.int16)
data = data.byteswap()
# The file has 512 x 512 pixel
data.shape = 512, 512

# The following code works fine. However, I still need:
#
# - Color bar (plt.color() does not work)
# - The x and y labels are 0 ... 500 and 0 ... 500 <= I want to change 
these labels. How.


fig   = plt.figure()
frame = plt.subplot(111)
frame.imshow(data)
frame.axis()
plt.xlabel('X (nm)')
plt.ylabel('Y (nm)')
plt.savefig("image")

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to