plotly

Succint way to add line segments to plotly graph (with python/jupyter notebook)?

你说的曾经没有我的故事 提交于 2020-07-30 01:52:45
问题 I want to create a lollipop plot with several horizontal line segments like this - https://python-graph-gallery.com/184-lollipop-plot-with-2-group. I'd like to use plotly since I prefer the graphics (and easy interactivity) but can't find a succint way. There's both line graphs (https://plot.ly/python/line-charts/) and you can add lines in the layout (https://plot.ly/python/shapes/#vertical-and-horizontal-lines-positioned-relative-to-the-axes), but both of these solutions require each line

r plotly how to get 3d surface with lat, long and z

荒凉一梦 提交于 2020-07-29 07:26:25
问题 I have latitude, longitude and data value for about 10 locations. Here's an example of a data frame I can easily construct for my problem x <- c("-108.6125","-108.5114","-108.805","-108.4014","-108.5615","-108.8349","-108.225","-108.3139","-108.5568","-108.4968") y <- c("39.02205","39.22255","39.598","38.89478","39.06429","39.27625","39.03","39.1306","39.14823","38.89795") z <- c("60.7735","56.45783","49.65","60.15","50","53.95417","50.825","56","55.843","38.73333") df <- data.frame(x = as

Python plotly scatter_geo modify hover data

折月煮酒 提交于 2020-07-22 14:19:40
问题 I want to modify hover data and leave ther for e.g. only bins data. I made following code, but hover_data parameter didn't work. What is the way to modify haver data? import plotly.express as px import plotly.graph_objs as go import pandas as pd rows=[['501-600','15','122.58333','45.36667'], ['till 500','4','12.5','27.5'], ['more 1001','41','-115.53333','38.08'], ] colmns=['bins','data','longitude','latitude'] df=pd.DataFrame(data=rows, columns=colmns) df = df.astype({"data": int}) fig=px

Python plotly scatter_geo modify hover data

荒凉一梦 提交于 2020-07-22 14:18:46
问题 I want to modify hover data and leave ther for e.g. only bins data. I made following code, but hover_data parameter didn't work. What is the way to modify haver data? import plotly.express as px import plotly.graph_objs as go import pandas as pd rows=[['501-600','15','122.58333','45.36667'], ['till 500','4','12.5','27.5'], ['more 1001','41','-115.53333','38.08'], ] colmns=['bins','data','longitude','latitude'] df=pd.DataFrame(data=rows, columns=colmns) df = df.astype({"data": int}) fig=px

Plotly: How to colorcode plotly graph objects bar chart using Python?

北慕城南 提交于 2020-07-19 11:50:40
问题 def update_graph_bar(named_count,**kwargs): traces = list() df = pd.DataFrame(list(Message.objects.all().values())) available_indicators = list(df['content'].unique()) for t in available_indicators: traces.append(go.Bar( x=[t], y=[df[df['content']==t]['timestamp'].count()], name='{}'.format(t),text=[df[df['content']==t]['timestamp'].count()], textposition='auto' )) layout = plotly.graph_objs.Layout(barmode='group',paper_bgcolor='#00FFFF', plot_bgcolor='rgba(0,0,0,0)',) return {'data': traces,

Plotly: How to colorcode plotly graph objects bar chart using Python?

廉价感情. 提交于 2020-07-19 11:50:27
问题 def update_graph_bar(named_count,**kwargs): traces = list() df = pd.DataFrame(list(Message.objects.all().values())) available_indicators = list(df['content'].unique()) for t in available_indicators: traces.append(go.Bar( x=[t], y=[df[df['content']==t]['timestamp'].count()], name='{}'.format(t),text=[df[df['content']==t]['timestamp'].count()], textposition='auto' )) layout = plotly.graph_objs.Layout(barmode='group',paper_bgcolor='#00FFFF', plot_bgcolor='rgba(0,0,0,0)',) return {'data': traces,

plotly orca not working on aws ec2 instance

…衆ロ難τιáo~ 提交于 2020-07-19 11:08:48
问题 I followed this to install conda plotly-orca on an AWS EC2 instance (built on anaconda-python3 image) but hit Cannot open shared object error when orca is invoked. The fix is to install libgtk2.0-0 and libgconf-2-4 packages which unfortunately are not available on AWS EC2 linux distribution (non ubuntu ). So I downloaded this standalone orca-1.3.1.AppImage for linux. I use --appimage-extract to extract orca-1.3.1.AppImage to /home/ec2-user/squashfs-root folder and run: xvfb-run --auto

plotly orca not working on aws ec2 instance

家住魔仙堡 提交于 2020-07-19 11:08:06
问题 I followed this to install conda plotly-orca on an AWS EC2 instance (built on anaconda-python3 image) but hit Cannot open shared object error when orca is invoked. The fix is to install libgtk2.0-0 and libgconf-2-4 packages which unfortunately are not available on AWS EC2 linux distribution (non ubuntu ). So I downloaded this standalone orca-1.3.1.AppImage for linux. I use --appimage-extract to extract orca-1.3.1.AppImage to /home/ec2-user/squashfs-root folder and run: xvfb-run --auto

plotly orca not working on aws ec2 instance

痞子三分冷 提交于 2020-07-19 11:07:50
问题 I followed this to install conda plotly-orca on an AWS EC2 instance (built on anaconda-python3 image) but hit Cannot open shared object error when orca is invoked. The fix is to install libgtk2.0-0 and libgconf-2-4 packages which unfortunately are not available on AWS EC2 linux distribution (non ubuntu ). So I downloaded this standalone orca-1.3.1.AppImage for linux. I use --appimage-extract to extract orca-1.3.1.AppImage to /home/ec2-user/squashfs-root folder and run: xvfb-run --auto

How to add colored background bars in plotly.js chart

六眼飞鱼酱① 提交于 2020-07-19 04:26:15
问题 How can "plot bands", or shaded areas in a chart, be added to a plotly-js chart? Something looking like this picture: (Which comes from a different product: Highcharts) Specifically, I would want to add background color to some portions (multiple of them) of a plotly chart, specifying [xFrom, xTo] coordinates for X, and painting the entire Y range, with arbitrary colors. For example, highlighting time windows of particular interest in a range (such as anomalies). 回答1: This example is from the