plotly.js

Updating candlestick data point using restyle in Plotly.js

£可爱£侵袭症+ 提交于 2019-12-24 21:06:24
问题 I am using a WebSocket connection to update a candlestick chart with live data. Creating the initial candlestick chart is relatively easy: var candleDiv = document.getElementById('candle-chart'); var data = { x: x, //Each of these is a single dimension array of the same length open: open, close: close, high: high, low: low, type: 'candlestick', }; var layout = { datarevision: candleCount, dragmode: 'zoom', showlegend: false, xaxis: { type: 'date', range: [x[x.length - 26], x[x.length - 1]], /

How to plot a vector field in Julia?

牧云@^-^@ 提交于 2019-12-10 12:56:26
问题 I want to plot a vector field in Julia. I could not find an example here. Here there are some examples using plotly , however, they do not work for me. I would like to plot the vector field by plotlyjs or plotly . Here is an example code in Julia: using Plots pyplot() x = collect(linspace(0,10,100)); X = repmat(x,1,length(x)); Y = repmat(x',length(x),1); U = cos.(X.*Y); V = sin.(X.*Y); streamplot(X,Y,U,V) Here is the Matlab example: [x,y] = meshgrid(0:0.2:2,0:0.2:2); u = cos(x).*y; v = sin(x)

Use plotlyProxy to add multiple traces when data changes

你离开我真会死。 提交于 2019-12-02 16:07:50
问题 Thank to this question: SO-Q I have now understood how to remove traces. In this case, I simply remove 0:2, but I can change that to i.e. array(O:unique(factor(df$group))) to remove however many groups my model had created in a previous run. What I haven't been able to figure out however, is how to add multiple traces, 1 for each factor in the target column, and color them by the colors in THECOLORS library("shiny") library("plotly") rock[,2] <- sample(c('A', 'B', 'C'), 48, replace = T)