GithubHelp home page GithubHelp logo

plotly.r-docs's Introduction

plotly.r-docs

The documentation for Ploty's R graphing library.

plotly.r-docs's People

Contributors

danton267 avatar hammadtheone avatar kvdesai avatar liamconnors avatar mahdis-z avatar nicolaskruchten avatar winstonpais avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plotly.r-docs's Issues

Examples charts not showing

Hi,

The examples charts on the R plotly site no longer display (see line and scatter for example).

In the console it has the error TypeError: Plotly.plot is not a function. (In 'Plotly.plot(graphDiv, x)', 'Plotly.plot' is undefined)

Not sure if this is most or all charts, but the few pages I clicked through all have this issue.

default color scheme for plotly contour plot lines

when several plots are combined as subplot, plotly R contour plots use different colors for the contour lines (since an update some months ago). Sadly, after 5 different colors there seem to be no more available and the subplot cannot be created. How can the contour line colors be set to be the same for different subplots?
My example shows this issue when the "grouping variable" is set to "block": https://sae-interactive-data.ethz.ch/sae-eschikon-live/

curvature to the lines between nodes

Hello,

I have been testing your example (https://plotly.com/r/network-graphs/) and everything works perfectly.
However it would be nice to add some curvature to the lines between nodes (similar to other edge bundling plots)
I have a big dataset (+700 nodes) and some angle to curve the lines would make it easy to visualize the plot.
But I'm not sure how can be done with plotly?
newplot(1)
Best regards,

Credential issue and lexical error for invalid character in json text.

Can't push plot from R using plot_ly::api_create(). Get the following error:

Error: lexical error: invalid char in json text.
                                       <html><head> <meta http-equiv="
                     (right here) ------^

In addition, warnings() produces this console output:

'/Users/robwiederstein/.plotly/.credentials': No such file or directory

These are appearing in spite of me setting environment variables for username and api key. More odd, is that plotly accepted the plot once--not sure why.

p to fig

This kind of example:

p <- plot_ly(x = ~s, y = ~s) %>%  layout(xaxis = a, yaxis = a)
p

should be rewritten as

fig <- plot_ly(x = ~s, y = ~s) 
fig <- fig %>% layout(xaxis = a, yaxis = a)
fig

CI has SSL issues

@jdamiba can you try to get this CI job running again please? Something changed upstream I think. I messed around with it a bit but wasn’t able to make progress... reach out to @HammadTheOne or @sacul-git if you get stuck?

3D surface plots

There is no information whatsoever on how to format data to use in the plotly. The data from the example (volcano) has no description. Usual format are meshgrids with a z coordinates, or triplets x,y,z.
The documentation provides no clear way to transform typical acquisition data into the necessary format.

Article for Exporting Static Image with Orca outdated.

Article under address ( https://plotly.com/r/static-image-export/ ) needs to be updated to reflect the deprecation of orca:

library(plotly)
 if (!require("processx")) install.packages("processx")
fig <- plot_ly(z = ~volcano) %>% add_surface()
orca(fig, "surface-plot.svg")

Warning message:
'orca' is deprecated.
Use 'kaleido' instead.
See help("Deprecated") 

R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)

other attached packages:
[1] reticulate_1.22 plotly_4.10.0 processx_3.5.2

dots overlay each other indepedent of 3D coordinates when size is specified

Hi,

I am making 3D plots and coloring the dots based on which cluster they belong to.
the issue only seems to arise when the size is specified.
It's difficult to illustrate with pictures since it is in 3D, but basically dots that are behind other dots in 3D, overlay dots in front of them.

#umap.3d is character vector of umap colnames in data
library(plotly)
p <-plot_ly(
  x = data[, umap.3d[1]],
  y = data[, umap.3d[2]],
  z = data[, umap.3d[3]],
  type="scatter3d",
  mode = "markers",
  size = 1,
  color = as.factor(data$kmeans_clustering)) %>%
  layout(
    title = "Clusters"
  );p

Pay attention to the pink and orange cluster down to the right. Here they are on top of all other dots.
image

After changing the angle you can see that they actually belong to another population far in the back.
image

Now without any size parameter.

p <-plot_ly(
  x = data[, umap.3d[1]],
  y = data[, umap.3d[2]],
  z = data[, umap.3d[3]],
  type="scatter3d",
  mode = "markers",
  color = as.factor(data$kmeans_clustering)) %>%
  layout(
    title = "pheno_clusters"
  );p

image
image

mistake in example network graph

Hi! I run the network graph example, but it did not work for me. I fixed it by changing the code in the "create edges" section as

edge_shapes <- list()
for(i in 1:Ne) {

v0 <- es[i,]$V1
v1 <- es[i,]$V2

v0_index <- which(V(G)$name == v0)
v1_index <- which(V(G)$name == v1)

edge_shape = list(
type = "line",
line = list(color = "#030303", width = 0.3),
x0 = Xn[v0_index],
y0 = Yn[v0_index],
x1 = Xn[v1_index],
y1 = Yn[v1_index]
)

edge_shapes[[i]] <- edge_shape
}

Unresponsive Legend for Ggplot

Although the documentation at https://plotly.com/ggplot2/legend/ says that the position of the legend can be moved, several of the examples show no response to changes in underlying code.

I've experience similar issues where changes made in ggplot do not propagate through the ggplotly function.

Mistake in documentation of ggplotly box plots

In this explanation for how to implement geom_boxplot with plotly (https://plotly.com/ggplot2/box-plots/#outliers) there is a mistake in the function used.

Currently the code example reads like this:

library(plotly)
set.seed(123)

df <- diamonds[sample(1:nrow(diamonds), size = 1000),]

p <- ggplot(df, aes(cut, price, fill = cut)) + 
  geom_boxplot(outlier.shape = NA) + 
  ggtitle("Ignore outliers in ggplot2")

# Need to modify the plotly object and make outlier points have opacity equal to 0
fig <- plotly_build(p)

fig$data <- lapply(fig$data, FUN = function(x){
  x$marker = list(opacity = 0)
  return(x)
})

fig

it should be

library(plotly)
set.seed(123)

df <- diamonds[sample(1:nrow(diamonds), size = 1000),]

p <- ggplot(df, aes(cut, price, fill = cut)) + 
  geom_boxplot(outlier.shape = NA) + 
  ggtitle("Ignore outliers in ggplot2")

# Need to modify the plotly object and make outlier points have opacity equal to 0
fig <- plotly_build(p)

fig$x$data <- lapply(fig$x$data, FUN = function(x){
  x$marker = list(opacity = 0)
  return(x)
})

fig

Note the difference fig$x$data instead of fig$data otherwise this won't remove the outliers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.