holoviews

How do i get my interactive Holoviews graph to display in Visual Studio (without Jupyter)?

假如想象 提交于 2019-12-13 03:58:59
问题 I'm mainly using Jupyter Notebook / Lab when using Holoviews for interactive plotting. How do I make Visual Studio display my interactive graphs and panels, without using the Interactive Jupyter inside Visual Studio? 回答1: One way to use interactive graphs from Holoviews etc in Visual Studio is executing code to show the graph in your browser (which Holoviews is meant for). The example below puts your Holoviews graph in a Panel and starts a Bokeh server. It opens a new tab on your browser and

How can I access values selected through a Stream in Holoviews?

谁说胖子不能爱 提交于 2019-12-13 03:55:54
问题 I'm plotting and selecting points with Holoviews import holoviews as hv import numpy as np N = 100 x = np.random.normal(size=N) y = np.random.normal(size=N) points = hv.Points((x, y)) selection = hv.streams.Selection1D(points) points.options(tools=["lasso_select"]) How can I get the indices selected from lasso as a vector in my Python environment for further analysis? 回答1: There's ample documentation, start for example here: http://holoviews.org/reference/streams/bokeh/Selection1D_tap.html

holoviews can't find flexx when using a Dimension value_format callback

天大地大妈咪最大 提交于 2019-12-11 15:44:12
问题 I am attempting to learn HoloViews within my ipython notebook and have run into an issue related to using a custom value_format for my kdims Dimension object. Right now, my xformat routine is basically a no-op but I want to experiment with transposing the default tick labels to reduce the number of ticks on my x-axis, however, I need to get it to work as is before I move on to that. Here is my code: %%output size=200 %%opts Curve [width=600 height=250] {+framewise} %%opts Curve.Load.Ticket

How do I achieve consistent appearance in different backends in HoloViews?

蹲街弑〆低调 提交于 2019-12-11 07:27:50
问题 I'm mystified by how to use HoloViews styles to customize plots and achieve a consistent appearance across backends. HoloViews is billed as a package that provides an abstraction layer to several backends, notably Bokeh and Matplotlib, but I'm completely failing in my attempts to get plots generated using these backends to look the same. Settings in one backend are ignored by another, and each backend has many (most) formatting options missing, so that it is necessary to break through the

View vs. Viewable with displaying widget

天涯浪子 提交于 2019-12-11 04:54:09
问题 I am putting together an interactive dashboard using the pyviz ecosystem. One feature of the dashboard is that the underlying data may change based on a widget selector. Below is an example code showing the issue I have with getting the time widget slider to appear: Package Versions : panel: 0.5.1 param: 1.9.0 holoviews: 1.12.3 geoviews: 1.6.2 Example : import xarray as xr import panel as pn import numpy as np import param as pm import holoviews as hv import geoviews as gv from matplotlib

Using Holoviews, how can I set a title?

时光毁灭记忆、已成空白 提交于 2019-12-11 02:47:55
问题 I have been trying to set a title when using Holoviews and Bokeh. I'm overlaying 3 plots on each other. The code looks like this: %%opts Curve [width=900 height=400 show_grid=True tools=['hover'] finalize_hooks=[apply_formatter]] %%opts Curve (color=Cycle('Category20')) %%opts Overlay [ legend_position='bottom' ] Curve (muted_alpha=0.5 muted_color='black' ) actual_curve = hv.Curve(df_reg_test, 'date', 'y', label='Actual') existing_curve = hv.Curve(df_reg_test, 'date', 'Forecast Calls', label=

Holoviews color per category

被刻印的时光 ゝ 提交于 2019-12-11 02:37:27
问题 I have been lately working with bokeh for plotting. I just found out about holoviews and wanted to plot a basic box plot. In my box plot I am trying to color per one of the categories I am grouping the data in. Here is the code I am using: hv.extension('bokeh') %opts BoxWhisker (box_color='blue') boxwhisker = hv.BoxWhisker(pool_ride_distance_time_year_less_hour, ['total_time', 'customer'], 'amount') plot_opts = dict(show_legend=False, width=800, height=400) I am trying to color it differently

Change x-axis (xlim) on holoviews histogram

眉间皱痕 提交于 2019-12-11 00:16:22
问题 In matplotlib we can change the limits of the x-axis with the xlim() method. Is there an equivalent method in HoloViews? I searched the HV options page, but didn't find anything that seemed to do this. I created the image below with the following code in a Jupyter notebook: import numpy as np import holoviews as hv hv.notebook_extension('bokeh', width=90) values = np.array([list of floats]) frequencies, edges = np.histogram(values, 10) hv.Histogram(frequencies, edges) How can I change the x

Chart Pandas DataFrame columns using Holoviews DynamicMap served via Flask

梦想与她 提交于 2019-12-10 11:20:56
问题 Following this tutorial, I am trying to visualise a dataset using Holoviews instead of Bokeh (sample data available here as a CSV file), serving the results using Flask. I decided to use Flask and not Bokeh Server because I am building a larger workflow using the former. My code is the following: from flask import Flask, render_template, request import numpy as np import pandas as pd from datetime import datetime from bokeh.embed import components from bokeh.io import curdoc import holoviews

How to set active tools in Holoviews

混江龙づ霸主 提交于 2019-12-09 03:24:26
Sometimes my plots get drawn with the pan tool active and sometimes they draw with pan and wheel_zoom active. I'd like to force wheel_zoom to be active upon rendering. Is there a way to do this? Since holoviews 1.11.0 was released the original answer has been outdated. HoloViews now has an explicit option to set the active tool(s), called active_tools which accepts a list of tool names or instances, e.g. to activate the wheel_zoom tool by default you would do this: hv.Curve([1, 2, 3]).options(active_tools=['wheel_zoom']) The rest of the answer below is outdated: For any options that are not