Questions tagged [ggplotly]

1

votes
0

answer
55

Views
1

votes
1

answer
55

Views

Plot multiple rows as columns with ggplotly

I have the following data dput(head(new_data)) structure(list(series = c('serie1', 'serie2', 'serie3', 'serie4'), Chr1_Coverage = c(0.99593043561, 0.995148711122, 0.996666194154, 1.00012127128), Chr2_Coverage = c(0.998909597935, 0.999350808049, 0.999696737431, 0.999091916132), Chr3_Coverage = c(...
Alexis_543
1

votes
0

answer
77

Views

ggplotly: how to return dates with stat_smooth?

I am trying to plot cumulative sums of groups over time, and add corresponding linear prediction lines for each group. The plot turns out well, however, I cannot read the dates of the prediction slopes on the x-axis as these are numbers. How can I change the code below so that stat_smooth returns...
jkhuc
1

votes
0

answer
54

Views

ggplotly function modifies line thickness and chart width

I encoutered problems concerning lines thickness and charts width using ggplotly function (from plotly R package ) Here is my ggplot chart that I want to make dynamic using ggplotly graphe_clustering
John
1

votes
1

answer
465

Views

Shifting the Position of X-Axis in a ggplot bar chart in R

The given script creates a horizontal bar plot using ggplot2 package. I want to shift the x-axis details and label on top of the chart. Please help. library(ggplot2) library(plotly) time
Robert J
1

votes
0

answer
88

Views

Input to asJSON(keep_vec_names=TRUE) is a named vector. In a future version of jsonlite, this option will not be supported

Please find below a reproductible example to explain my issue (I am using manipulateWidget R package which is directly related to Shiny R package): library(ggplot2) library(plotly) library(manipulateWidget) my_data
John
1

votes
0

answer
87

Views

Plotly and stat_summary produce “NA” in tooltip

I'd like to use stat_summary to show mean values of my data on a ggplot2 graph, and use plotly to show the data and mean values in the tooltip. I'm using the dev version of ggplot2 (ggplot2_2.2.1.9000) and I just reinstalled plotly (plotly_4.7.1). stat_smooth works - you can see I'm hovering over th...
Nova
1

votes
0

answer
56

Views

Change the quantile calculation method used in plotly

I try to understand how to deal with the ggplotly quantile calcultion method. vec % t() %>% as.data.frame() %>% mutate_if( is.numeric, round, 3) This is the quantile i can calculate 1% 2.5% 5% 10% 25% 50% 75% 90% 95% 97.5% 99% 1 6.476 6.712 7.105 7.513 9.073 9.931 11.227 12.28...
Vincent Guyader
1

votes
0

answer
223

Views

Increase distance between text and title on the y-axis does not work in plotly

Hello I have created a shiny app which includes a scatter plot cretaed with plotly. My problem is that I cannot increase the space between the axis titles(y) and axis labels despite using axis.title.y = element_text(margin = margin(t = 0, r = 20, b = 0, l = 20)) based on Increase dustance between te...
firmo23
1

votes
0

answer
139

Views

Temporarily exclude points in plotly graph

In the following plotly example (taken from here), is it possible to introduce a function that allows the user to click on a point to 'grey it out', so it would be excluded from the 'active' dataset, and the loess fit line would automatically adjust to the new dataset? The point(s) could then be cli...
J.Con
1

votes
0

answer
84

Views

Using plotly inside an rmarkdown notebook (html notebook) outside of Rstudio

Is it possible to use the html_notebook aka r notebook format with plotly? When I use the rmarkdown file (named temp.Rmd) shown below, I can knit to HTML and everything works -- that is, I can view a proper temp.html file. However, when I use the Preview Notebook button within RStudio which opens a...
JasonAizkalns
1

votes
0

answer
34

Views

ggplot plotly unable to plot different lines with differing data arguments?

I am unable to plot lines within plotly with different data arguments for the lines. Is this normal? Any workaround or bug fix for this? y_data
BigTimeStats
1

votes
2

answer
57

Views

change the scale of a two-axis graph Y - ggplot2

Wanting to study the impact of the weather on road traffic, I would like to make a graph with the x axis, the months, as the Y axis on the right, the temperatures and precipitation, and the Y axis on the left, the number of cars. However, when I generate this graph, precipitation and temperatures di...
Elodie P.
1

votes
0

answer
42

Views

Change placement of labels using ggplotly

I have a problem when using ggplotly function on my ggplot2 plot. Text labels overlap with the points (screenshot is attached.) Code: d1
Aleksander
1

votes
0

answer
97

Views

Why does ggplotly lose my scale_size_continuous legend?

I am developing a Shiny app to interactively display a bubbleplot using ggplot2, and I would like to add plotly functionality to it. The following creates data for a reproducible example: # Load packages library(shiny) library(shinythemes) library(tidyverse) # create data Name
berr3415
1

votes
1

answer
28

Views

Individual curves according to class. From ggplot to plotly

I would like to trace individual curves with a color modification during the time according to a class. I've found how to do it with ggplot: library(ggplot2) library(plotly) id
aleksik
1

votes
0

answer
45

Views

Scatter point click to weblink disabled when ggplot/ggplotly includes annotations or shapes

I am working on a shiny app using shiny dashboard and trying to make the plot points clickable. When clicked, an associated webpage should appear from the associated url column in the dataset. I am using plotly, converting a ggplot to a ggplotly. Unfortunately, my ggplot has annotations and shapes...
Margo
1

votes
0

answer
78

Views

How to remove mysterious tilda from R Plotly tooltip?

I’m using R's ggplot and passing it through ggplotly to generate interactive charts on my Shiny app. However, I have no idea why my tooltip keeps displaying a “~” sign before the variable name and I can’t seem to remove it. This appears for all my charts in my Shiny app. How can I remove the...
ZPeh
1

votes
1

answer
60

Views

ggplotly and multiple highlight functions

How can I use two or more highlight functions on a ggplotly object. In the following example I want to highlight the hovered bar in black the clicked bar in blue When using 2 highlight functions, only the last one is used and it obviously overwrites the previous one. So how can I define different...
SeGa
1

votes
0

answer
48

Views

Tooltip for lines with ggplot and ggplotly

The following code draws a triangle in ggplotly. I want to use the labels (from my data frame) as tooltips. How can I do this? library(tibble) library(dplyr) library(ggplot2) library(ggplotly) data_points % left_join(data_points %>% rename(To = Node, X_to = X, Y_to = Y)) p
takje
1

votes
1

answer
24

Views

Detailed Heatmap with plotly

I tried to create a heatmap with the following data: Study Intervention Outcome Study_1 Monetary_Incentive Emission_Reduction Study_2 Govermental_Change Emission_Reduction Study_3 Nudges Renewable_Energy_Usage Study_3 Market_based_intervention...
Yonko
1

votes
0

answer
47

Views

Smooth transitions for line plots using plotly in R

When I try this code, the lines don't transition as intended. Unwanted diagonal lines appear. It should be that the line follows the points, which are transitioning correctly. Any ideas on how to fix this? library(ggplot2) library(plotly) x=rep(seq(.1, 10, by=.1), each=10) frame=rep(1:10, times=1...
bmac
1

votes
0

answer
25

Views
0

votes
0

answer
14

Views

How to create life Expectancy Graph

I am trying to create a Life Exp Vs. Health Expenditure Evolution graph using ggplot2 and plotly with data set life-expectancy-vs-health-expenditure.csv. Here is a snap shot of what the data looks like: When I am trying to create the graph, it gives me an frame error, saying its ignoring the frame=y...
AceDaCase
0

votes
0

answer
4

Views

ggplotly simultaneously labelling the same point on different facet grids

I need to get the same point highlighted using ggplotly on different ggplot facet grids. The below example shows wind vs temp for 5 months of the year, with days of each month as a point. So, for example, if I hover over '9' on month 5, the top-left most point, I would also like the point '9' to be...
user10022403
1

votes
1

answer
44

Views

How to solve inconsistant ploting while using ggplotly for simple boxplot?

I am trying to utilize the new ggplot2 (dev version) feature to make my plot interactive. I also have plotly-dev version installed. However, to me it seemed like its not working as promised. Consider this, gg
Droid-Bird
1

votes
1

answer
112

Views

Is output from ggplotly not a full-featured plotly object?

The purpose of the code is to produce an interactive plotly chart with shaded vertical areas on specified subsets on X-axis. The first step is to construct a ggplot2 object, with shaded vertical areas constructed using geom_rect, then use ggplotly to produce a plotly object. Since ggplotly does not...
Aex
1

votes
2

answer
296

Views

Issue when trying to plot geom_tile using ggplotly

I would like to plot a ggplot2 image using ggplotly What I am trying to do is to initially plot rectangles of grey fill without any aesthetic mapping, and then in a second step to plot tiles and change colors based on aesthetics. My code is working when I use ggplot but crashes when I try to use ggp...
anle
1

votes
1

answer
109

Views

Show lower and upper bounds in geom_bin histogram (ggplot2)

In the following histogram, how can I include the lower and upper bounds for each bin as tooltip text in ggplotly? library(ggplot2) library(plotly) csub
Hendrik
1

votes
1

answer
62

Views

R plotly: not enough granularity for the size of the bubbles?

In the bubble graph generated by the code below, I don't have enough granularity for the sizes of the bubble. There is a ratio of 20,000 between the smallest (size 100) bubble and the largest bubble (size 2,000,000). As a consequence the bubble of size 100 has the same area than the bubble of size 1...
S. Tim
1

votes
2

answer
438

Views

Strange formatting of legend in ggplotly in R

I'm trying to turn a ggplot into a plotly. The ggplot renders fine, but when I put it through ggplotly, suddenly the legend adds parenthesis and ',1' after the label. Here's a sample fake data: sorted1
iod
1

votes
1

answer
33

Views

Different tooltips after scale shift with ggplotly

I am trying to make a combined bar + point chart with ggplot and ggplotly. I am using a scale shift for the bars so that the origin starts at 100. I'm successful, but the tooltip values are different for bars and points: bars have shifted values while points retain original values. I would like to h...
Xlrv
1

votes
1

answer
182

Views

Labels next to points in a plot using ggplotly() in R

I was wondering if there is a way to put labels next to points in a ggplotly() plot. If I use geom_text or geom_text_repel in ggplot(), the result is ok. But then if I call ggplotly(), I cannot see the labels I created anymore. For example: require(ggplot) require(plotly) x
Sergio Nolazco
1

votes
1

answer
75

Views

Empty charts added by ggplotly when using facet_wrap

Is there any way to remove the empty charts that are added to the last row when using facet_wrap with ggplotly? I'm using facet_wrap to generate a plot like this: library(ggplot2) library(plotly) g=ggplot(data=mtcars, aes(x=mpg, y=wt))+geom_point()+facet_wrap(~hp) print(g) That gives this figure:...
bmac
1

votes
1

answer
59

Views

how can I stop ggploty() adding lines between map points?

I'm using plotly package to convert my ggmap into HTML. However, after I apply ggplotly(), there are lines produced between map points. My df looks like: df
Mr369
1

votes
1

answer
127

Views

Maps not showing in the RStudio Viewer when using plotly in R

I've made a map using ggplot2 in R. I am now trying to use plotly so that I can make it more interactive (and in particular use tooltips). However, anything I try ends up with me just getting a blank viewer panel in RStudio. I am able to view other things with plotly (for e.g. a basic line chart), b...
Megan
1

votes
1

answer
191

Views

generate seasonal plot, but with fiscal year start/end dates

Hello! Is there a way to index a chart to start and end at specific points (which may be out of numeric order)? I have data that begins October 1st, and ends September 31st the following year. The series repeats through multiple years past, and i want to build a daily seasonality chart. The challen...
Joe
1

votes
1

answer
42

Views

Put labels in ggplotly R

I would like to put the labels of my doughnut charts in the middle of those, but I tried a solution and it doesn't appear where I want. It's for a teamwork project so any help would be really appreciated. Thank you. Here is our code: p1
TWCars
1

votes
1

answer
0

Views

Show point labels on hover when using fviz_dend from factoextra with ggplotly

I'm able to generate a plotly tree with the following: library(factoextra) library(plotly) hcl
pxq
1

votes
1

answer
0

Views

Change the color of point on click and keep it unchanged using R Shiny

I am trying to work on creating the graph using plotly. When the user clicks on any geom_point in the plot using R shiny, it should change the color and keep it unchanged. Currently, my code is working fine. When the user clicks on any geom_point in the plot, it is changing the color. But when I cli...
tarun Mirani

View additional questions