Hi Dzengiz,
just now I saw that you are trying to use a deprecated function.
The colorbar, colormap and title you get with:
# be aware that the first return is axis object and second is mappable
yourcmap = mpl.cm.jet # use cm according to your needs
ax, ppi = wradlib.vis.plot_ppi(masked_array, r, az, autoext=None,
site=(x,y), elev=0.4, vmin=-0.0, vmax=80.0, cmap=yourcmap)
t = plt.title('Your special Title')
t.set_y(1.05) # adjust spacing as necessary
cbar = plt.gcf().colorbar(ppi, pad=0.075) # adjust padding as necessary
cbar.set_label('reflectivity [dBZ]')
plt.tight_layout() # test tight-layout, it may help beautifying the plot
There are many more possibilities to add colorbars, check also the
CG_Plot tutorial.
Cheers,
Kai
Am 28.03.2014 05:00, schrieb Dzengiz Tafa:
> Finally some results :-)
>
> I made it work on a simple basemap of europe, along with the blue marble
> display. The only thing i can not get to work is my colorbar.
> It seems I have some more fiddling around to do. Here you can see what i
> created. Reflectivity (elevation angle 0.4).
>
> <
https://lh5.googleusercontent.com/-FvKPkQOEEY8/UzTlRILkjpI/AAAAAAAAAjs/3sa37twtbnA/s1600/resultaat.png>
>
> As you can see the plot now includes the gates instead of a contourfill of
> the precipitation. Im quite impressed with the result.
>
> However... Is it possible to provide some guidelines as to how I can insert
> a colorbar & title?
>
>
> When erasing the comment char before the colorbar rule (see attachment) I
> get the error message that there is no "autoscale=true" anywhere. I have
> tried to find what it meant, but It seems i can not get it to work.
>
> I would also like to add a title, but when adding a title (or trying to add
> one) i get the error message that "the tuple has no attribute 'title'". I
> tried using the functions in the "vis.py" to plot my scales, title,
> subtitle & date, time but I guess it's because of the way i built up the
> vis.plot_ppi method. Am i correct? If so, is there anyway around it?
>
> Also: when i try to change the colormap to gist_ncar, nothing seems to
> happen. It still keeps its colormap (i think its "jet" but I am not sure of
> this... It Iooks like it though). Is it possible to point me to the
> method/py where the colormap is fixed? I can then easily replace the map
> with the one I want, or just copy the function with another colormap in it.
> No biggy. I like to keep some diverse colormaps, so i can then call the
> right plot-function whenever i feel another colormap is a good idea.
>
> The thing is that I have velocity plots and i can not get the "seismic" map
> to work (you know the red-blue one) on my velocity plots since i dont know
> where i can choose the colormap: as you can see here it's only this blue
> color, no matter what colormap I try to set.
>
> <
https://lh6.googleusercontent.com/-vi6OlCDJE0A/UzTxzmmvDJI/AAAAAAAAAj8/1IpTAqCbdS8/s1600/velocity.png>
>
> So the main search now is the colormaps, colorbars & titles. It could very
> well be that i am placing the colormap assignment, colorbar & title wrong,
> but then again: i get no errormessage so... they might be overwritten
> somewhere. If you don't mind i placed an attachment so you can see what i
> did.
>
> Again, thank you very much for your kind help, It has brought me further
> that i'd dare have hoped. It was a rough ride, but now the foundations were
> set, it turned out to be quite smooth sailing.
>
> Grtz
>
> Dzengiz
>
>
> On Thursday, March 27, 2014 5:57:38 AM UTC+1, Dzengiz Tafa wrote:
>>
>> Hi everybody.
>>
>> I am new to the group & wradlib so excuse me for a possible stupid
>> question.
>> I find myself struggling to plot a ppi on a basemap. eg a ppi on a
>> background of the Benelux like the one here (hosted & created by the Bonn
>> Meteorological institute).
>>
>>
>> <
https://lh5.googleusercontent.com/-qiY1MnI2qmo/UzOsjkb7GbI/AAAAAAAAAi4/esOnXNNyxwM/s1600/bonn+radarimage+ppi.png>
>>
>> I found a way to plot the data from the Jabbeke site in Belgium but only
>> using the "basemap.contourfill" function.
>> Although it is a good way to show precipitation as a whole I loose a lot
>> of detail. To that extent that I loose the gate to gate signatures on which
>> the presentation I am to give on the 11th of may is based (tornado event of
>> november 3d, 2013). An example of the product using the basemap.contourfill
>> function is here:
>>
>>
>> <
https://lh4.googleusercontent.com/-PmUCaBMND6U/UzOuDSBjFjI/AAAAAAAAAjE/udxvl7lRJ-I/s1600/nexrad+kleurenschaal+1dbz+interval.png>
>>
>> Can anyone point me in the right direction as to how I can plot the radar
>> data which gives a presentation like the upper picture (Bonn Meteorological
>> institute)? I tried following the examples but as good as they are, they
>> lead me nowhere.
>>
>> If somebody could find the time to set me on the right track or perhaps
>> share some code, I would be very grateful as it will surely help me present
>> the best material on the conference I need to attend for my talk about the
>> severeweather outbreak.
>>
>> Grtz,
>>
>>
>> Dzengiz
>>
>