Select to view content in your preferred language

Empty Plot Output

1799
14
04-04-2022 10:06 AM
Ed_
by MVP Regular Contributor
MVP Regular Contributor

Hello, I am trying to create a simple "plotly" timeseries plot in Insights Desktop. But I am getting a blank output for some reason.

How can I fix this?

Code

 

library(tidyverse)

library(plotly)

# Import the air temperature dataset to create a plotly plot.
df = read.csv("O:/local_path.csv")

# Plot
month.gg.bwrd_clip = df %>%
#Calculating mean by year
group_by(year) %>%
summarise(tmean = mean(tmean,na.rm = TRUE)) %>%
ggplot(aes(x= year, y=tmean)) +
geom_line(stat = "identity") +
xlab("Year") +
ylab("Average Temperature")

ggplotly(month.gg.bwrd_clip)

 

 

SaadullahBaloch_0-1649091981835.png

 

 

Question | Analyze | Visualize
Tags (3)
0 Kudos
14 Replies
Ed_
by MVP Regular Contributor
MVP Regular Contributor

Thanks for the clarification Ian.

Cheers

Question | Analyze | Visualize
0 Kudos
Arlo
by
New Contributor II

@Ed_  Were you able to get this to work? I'm running in to the same issue. 

@Ian_Muehlenhaus  You confirmed that Plotly is supported by Insights correct? Are there any additional steps needed to render those plots?

Thanks!

0 Kudos
Ed_
by MVP Regular Contributor
MVP Regular Contributor

@Arlo Insights (2021.3) has some issue supporting `Plotly` in `R` . I did contact their team via email and was told that this will be fixed but they haven't gotten back to me yet. It seems to me that R has limited support in Insights which should not be the case as R is a very powerful analytics tool and deeper R integration into Insights will further strengthen Insights as a whole.

Question | Analyze | Visualize
0 Kudos
UGPSV_RNVV
New Contributor

Hey, I'm having the same issue. I would very much appreciate being informed if something new comes up!

 

Thank you!

0 Kudos
ChrisWesson
Esri Contributor

Not all libraries are compatible with our setup, however most of the time the issue of plots not showing is usually a JavaScript permissions thing common to Jupyter Notebooks not just Insights. It can often be solved with setting the output format to either “notebook” or “offline”.

I'd need to do some digging to get it working in Plotly, but if for now I give you the easier example of Bokeh, it works if you add this to your script:

from bokeh.io import output_notebook
output_notebook()

Hope that at least points you all in the right direction until we can post the answer for Plotly specifically.

0 Kudos