I am a new user to the python & matplotlib, this might be a simple question
but I searched the internet for hours and couldn't find a solution for this.
I am plotting precipitation data from which is in the NetCDF format. What I
find weird is that, the data doesn't have any negative values in it.(I
checked that many times,just to make sure). But the value in the colorbar
starts with a negative value (like -0.0000312 etc). It doesnt make sense
because I dont do any manipulations to the data, other that just selecting a
part of the data from the big file and plotting it.
So my code doesn't much to it. Here is the code:
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
from netCDF4 import Dataset
m = Basemap(width=06.e6,height=05.e6,projection='gnom',lat_0=15.,lon_0=80.)
x, y = m(*np.meshgrid(lo,la))
The output that I got for that code was a beautiful plot, with the colorbar
starting from the value -0.00001893, and the rest are positive values, and I
believe are correct. Its just the minimum value thats bugging me.
I would like to know:
Is there anything wrong in my code? cos I know that the data is right.
Is there a way to manually change the value to 0?
Is it right for the values in the colorbar to change everytime we run the
code, cos for the same data, the next time I run the code, the values go
like this " -0.00001893, 2.00000000, 4.00000000, 6.00000000 etc"
I want to customize them to "0.0, 2.0, 4.0, 6.0 etc"
View this message in context: http://old.nabble.com/weird-range-value-in-the-colorbar%2C-matplotlib-tp30001558p30001558.html
Sent from the matplotlib - users mailing list archive at Nabble.com.