Estuarine and Coastal Environment, Coastal Engineering, Coastal Management, Sustainability Science
Blog

Python

Bar plots on Google Earth Pro

Creating Bar plots kml files for Google Earth Pro using Python googleearthplot referring to this site. Install Suppose pandas is installed. Install simplekml and googleearthplot. pip install simplekml pip install googleearthplot googleearthplot is a Python2 code and some modification is required in Python3 because of an error associated with print statement. First find the location of installed googleearthplot as follows: pip show googleearthplot Edit googleearthplot.py to modify the lines of print statement by converting print **** to print(****) using parentheses. Usage Open a Jupyter Notebook and import packages. Referring to the original site, some examples are shown. Double cricking on created kml file, a plot should be presented on Google …

Time series plotting using hvPlot

hvPlot, a component of PyViz ia a new interactive plotting tool, which is a wrapper of Bokeh. hvPlot is easy to customize plotting options. However, currently there are some drawbacks, such as difficulty in adjusting aspect ratio of graph area, which may be resolved in Bokeh 1.1, slow processing, and cumbersome in exporting high resolution PNG file, comparing to Matplotlib. Default time series plotting Suppose df is a pandas DataFrame having a time series index and columns of ‘kion’ and ‘sped’, which are actually a dataset of air temperature and wind speed at Chiba Observatory, Japan, provided by Japan Meteorological Agency. import hvplot.pandas df[[‘kion’,’sped’]].hvplot() Customized plotting Now one column of …

PAGETOP