Hi ,
I am plotting Significant wave height and direction both by giving Holomap features .
But when i am using restarize with gv.vectorfield then i am getting the actual vectordirection plot .
i required restarize as after using holomap features i want to do zoomin and my data should get changed as dynamic data .
so how i can modify my code so that i can get Trimesh + vectorfield plot with restarize .
from shapely.geometry import Point, Polygon
`
import pandas as pd
import numpy as np
import geoviews as gv
import bokeh
import datashader.utils as du, datashader.transfer_functions as tf
from scipy.interpolate import griddata
import holoviews as hv
from holoviews import opts
from holoviews.operation.datashader import datashade , rasterize
hv.extension("bokeh")
from bokeh.models import ColorBar
import math
from bokeh.plotting import output_file, save
from bokeh.models import HoverTool
from scipy.io import loadmat
import datetime
import pandas as pd
from dateutil.parser import parse
from bokeh.plotting import figure
import datashader as ds
from scipy.interpolate import InterpolatedUnivariateSpline
from datetime import timedelta
from numpy import ogrid
datamat = loadmat('IOEC_ECM_noDA_20190703_masked.mat')
Xp = datamat['Xp']
Yp = datamat['Yp']
strt = datetime.datetime(2019, 7, 4, 0, 0)
end = datetime.datetime(2019, 1, 13, 0, 0)
hmap = hv.HoloMap(allplot, kdims='Date and Time :')
hmap.options(**opts)
restarize(hmap).options(**opts)
I want return tilesgv.TriMesh((tri_sub,gv.Points(verts)))gv.VectorField((xi[::15,::15], yi[::15,::15], angle[::15,::15], mag[::15,::15]))`
above code to work fine so that i can get Trimesh as well as vectorfield plot return from for loop and restarize at last after holomap , i.e restarize(hmap).options(**opts) . so that i can do dynamic data update while zoomin and zoom out.
Hi , I am plotting Significant wave height and direction both by giving Holomap features . But when i am using restarize with gv.vectorfield then i am getting the actual vectordirection plot . i required restarize as after using holomap features i want to do zoomin and my data should get changed as dynamic data . so how i can modify my code so that i can get Trimesh + vectorfield plot with restarize . from shapely.geometry import Point, Polygon
` import pandas as pd import numpy as np import geoviews as gv import bokeh import datashader.utils as du, datashader.transfer_functions as tf
from scipy.interpolate import griddata import holoviews as hv from holoviews import opts from holoviews.operation.datashader import datashade , rasterize hv.extension("bokeh") from bokeh.models import ColorBar import math from bokeh.plotting import output_file, save from bokeh.models import HoverTool from scipy.io import loadmat import datetime import pandas as pd from dateutil.parser import parse
from bokeh.plotting import figure import datashader as ds from scipy.interpolate import InterpolatedUnivariateSpline from datetime import timedelta from numpy import ogrid datamat = loadmat('IOEC_ECM_noDA_20190703_masked.mat') Xp = datamat['Xp'] Yp = datamat['Yp'] strt = datetime.datetime(2019, 7, 4, 0, 0) end = datetime.datetime(2019, 1, 13, 0, 0)
def perdelta(strt, end, delta): curr = strt while curr < end: yield curr curr += delta
Read element file
data = pd.read_table('fort.ele',delim_whitespace=True,names=('A','B','C','D'))
tri_new = pd.read_csv('fort.ele', delim_whitespace=True, names=('A', 'B', 'C', 'D'), usecols=[1, 2, 3], skiprows=1, dtype={'D': np.int}) def plotthis(datetime): dat=datetime dt = parse(str(dat)) yr = dt.year mn = dt.month d = dt.day hr = dt.hour mi = dt.minute
print(y,mn,d,hr,mi)
allplot={k.strftime("%Y-%m-%d %H"):plotthis(k)for k in perdelta(strt, strt + timedelta(days=1), timedelta(hours=18))} colorbar_opts={ 'major_label_overrides': { 0:'0',
levels=[0,0.2,0.4,0.6,0.8,1,1.2,1.4,1.6,1.8,2,2.2,2.5,3,]
def plot_limits(plot, element): plot.handles['x_range'].min_interval = 100 plot.handles['x_range'].max_interval = 55000000
3000000
opts = dict(width=700, height=700, tools=['hover','save','wheel_zoom'],hooks=[plot_limits],title=" \t\t\t\tSignificant Wave Height (m) ",fontsize={'title': 26, 'xlabel':15, 'ylabel':15, 'ticks':12} )
hmap = hv.HoloMap(allplot, kdims='Date and Time :') hmap.options(**opts)
restarize(hmap).options(**opts)
I want
return tilesgv.TriMesh((tri_sub,gv.Points(verts)))gv.VectorField((xi[::15,::15], yi[::15,::15], angle[::15,::15], mag[::15,::15]))` above code to work fine so that i can get Trimesh as well as vectorfield plot return from for loop and restarize at last after holomap , i.e restarize(hmap).options(**opts) . so that i can do dynamic data update while zoomin and zoom out.