plotly

How to annotate a point outside the plot itself?

眉间皱痕 提交于 2020-12-06 04:15:25
问题 I have a plot like this and want to add text above the line with text 'TODAY'. I was trying with annotations annots.append(dict(x='2020-03-29',y=len(df)+1,text='<b>Today<b>', showarrow=False, font=dict(color='black'))) But the output is as such and I want it above the plot and not changing the structure of the plot! 回答1: You can do so in three steps: adjust margins to make room for the text using fig.update_layout(margin=dict()) add line using fig.add_shape() add text outside plot using add

Main title and legend.position issue on ggplotly

跟風遠走 提交于 2020-12-06 03:59:41
问题 I am having issues on how to position the main title and legend in ggplotly. I would like my main title to be on the top of the graph and left aligned. I would also like my legend to be at the bottom center of the graph Here is my code library(ggplot2) library(dplyr) library(tidyr) library(plotly) Month_Names <- c("2010-11","2010-12", "2011-01","2011-02","2011-03","2011-04","2011-05","2011-06","2011-07","2011-08","2011-09","2011-10","2011-11","2011-12", "2012-01","2012-02","2012-03","2012-04"

How to export/save an animated bubble chart made with plotly?

别来无恙 提交于 2020-12-06 03:51:29
问题 How to export/save an animated bubble chart made with plotly? (For instance, the one was made following the link below) I would like to have it in a gift or some format with better resolution. Thank you in advance. https://www.kaggle.com/aashita/guide-to-animated-bubble-charts-using-plotly 回答1: There is no possibility to do this in plotly. Please use givemaker and save every step in the animation as a single picture to later combine them to a gif. Follow this source. Further explanation on

R - plotly error object … not found

。_饼干妹妹 提交于 2020-12-05 07:18:29
问题 I try to run a sample line with iris data set gives object '...' not found error. Is there any I need to check specific in my environment? library(plotly) p <- plot_ly(iris, x = Petal.Length, y = Petal.Width,color = Species, mode = "markers") Error in plot_ly(iris, x = Petal.Length, y = Petal.Width, color = Species, : object 'Petal.Length' not found 回答1: This happen to be known issue reported to plotly. To fix your example you should add tilde "~" to the data frame columns names: library

Plotly: How to select graph source using dropdown?

左心房为你撑大大i 提交于 2020-12-02 08:45:19
问题 I'm trying to embed multiple, selectable graphs in a single figure using Plotly, using a dropdown figure. I followed the dropdown example from Plotly, but they only show how to change graph characteristics (like visible, or type), not the underlying data. In my situation, I have a static X-axis and want to change the Y-values. Here's a minimal working example that can be run in a jupyter notebook: import plotly from plotly import graph_objs as go, offline as po, tools po.init_notebook_mode()

Create dropdown button to filter based on a categorical column

做~自己de王妃 提交于 2020-12-01 23:45:52
问题 I have a dataframe like this: import pandas as pd df = pd.DataFrame() df['category'] = ['G1', 'G1', 'G1', 'G1','G1', 'G1','G1', 'G2', 'G2', 'G2', 'G2', 'G2', 'G2', 'G2'] df['date'] = ['2012-04-01', '2012-04-05', '2012-04-09', '2012-04-11', '2012-04-16', '2012-04-23', '2012-04-30', '2012-04-01', '2012-04-05', '2012-04-09', '2012-04-11', '2012-04-16', '2012-04-23', '2012-04-30'] df['col1'] = [54, 34, 65, 67, 23, 34, 54, 23, 67, 24, 64, 24, 45, 89] df['col2'] = round(df['col1'] * 0.85) I want to

Create dropdown button to filter based on a categorical column

本秂侑毒 提交于 2020-12-01 23:42:50
问题 I have a dataframe like this: import pandas as pd df = pd.DataFrame() df['category'] = ['G1', 'G1', 'G1', 'G1','G1', 'G1','G1', 'G2', 'G2', 'G2', 'G2', 'G2', 'G2', 'G2'] df['date'] = ['2012-04-01', '2012-04-05', '2012-04-09', '2012-04-11', '2012-04-16', '2012-04-23', '2012-04-30', '2012-04-01', '2012-04-05', '2012-04-09', '2012-04-11', '2012-04-16', '2012-04-23', '2012-04-30'] df['col1'] = [54, 34, 65, 67, 23, 34, 54, 23, 67, 24, 64, 24, 45, 89] df['col2'] = round(df['col1'] * 0.85) I want to

Create dropdown button to filter based on a categorical column

两盒软妹~` 提交于 2020-12-01 23:41:04
问题 I have a dataframe like this: import pandas as pd df = pd.DataFrame() df['category'] = ['G1', 'G1', 'G1', 'G1','G1', 'G1','G1', 'G2', 'G2', 'G2', 'G2', 'G2', 'G2', 'G2'] df['date'] = ['2012-04-01', '2012-04-05', '2012-04-09', '2012-04-11', '2012-04-16', '2012-04-23', '2012-04-30', '2012-04-01', '2012-04-05', '2012-04-09', '2012-04-11', '2012-04-16', '2012-04-23', '2012-04-30'] df['col1'] = [54, 34, 65, 67, 23, 34, 54, 23, 67, 24, 64, 24, 45, 89] df['col2'] = round(df['col1'] * 0.85) I want to

Create dropdown button to filter based on a categorical column

一个人想着一个人 提交于 2020-12-01 23:39:14
问题 I have a dataframe like this: import pandas as pd df = pd.DataFrame() df['category'] = ['G1', 'G1', 'G1', 'G1','G1', 'G1','G1', 'G2', 'G2', 'G2', 'G2', 'G2', 'G2', 'G2'] df['date'] = ['2012-04-01', '2012-04-05', '2012-04-09', '2012-04-11', '2012-04-16', '2012-04-23', '2012-04-30', '2012-04-01', '2012-04-05', '2012-04-09', '2012-04-11', '2012-04-16', '2012-04-23', '2012-04-30'] df['col1'] = [54, 34, 65, 67, 23, 34, 54, 23, 67, 24, 64, 24, 45, 89] df['col2'] = round(df['col1'] * 0.85) I want to

Create dropdown button to filter based on a categorical column

 ̄綄美尐妖づ 提交于 2020-12-01 23:38:44
问题 I have a dataframe like this: import pandas as pd df = pd.DataFrame() df['category'] = ['G1', 'G1', 'G1', 'G1','G1', 'G1','G1', 'G2', 'G2', 'G2', 'G2', 'G2', 'G2', 'G2'] df['date'] = ['2012-04-01', '2012-04-05', '2012-04-09', '2012-04-11', '2012-04-16', '2012-04-23', '2012-04-30', '2012-04-01', '2012-04-05', '2012-04-09', '2012-04-11', '2012-04-16', '2012-04-23', '2012-04-30'] df['col1'] = [54, 34, 65, 67, 23, 34, 54, 23, 67, 24, 64, 24, 45, 89] df['col2'] = round(df['col1'] * 0.85) I want to