I am using RCHHT to create an interactive scatter plot in R. The following code works fine:
Library (RCHHT) test.df & lt; - data.frame (x = sample (1: 100, size = 30, replace = t), y = sample (10: 1000, size = 30, replacement = t), g = representative (c ('a', ' B '), each = 15) N1 and LT; - NPL1 (I ~ X, Group = "G", Data = Test DD, Type = 'Scatterchart') N1
I have a log-scale for both the X-and Y-axis To use How can I design HTML / JavaScript without hacking it in RCR?
Update 1: A more realistic and stable version of the plot I am trying to plot with RCHHT:
set.seed (2935) y_nbinom & Lt; - c (rnbinom (n = 20, size = 10, mu = 90), rnbinom (n = 20, size = 20, mu = 1282), rnbinom (n = 20 (N = 20, size = 40, mu = 1000 ), Rnbinom (n = 30, mu = 12575)) x_nbinom & lt; -c (rnbinom (n = 20, size = 30, mu = 100), rnbinom (n = 20, size = 40, 20, size = 50 , Mu = 10000)) x_fixed & lt; -c (Representative (10020), Representative (1000,20), Representative (10000,20)) Realp <- Representative (0: 2, each = 2) * 20 + sample (1:20, size = 6, location = F) TDF and LT; - data.frame (y = c (y_nbinom, y_nbinom, y_nbinom [realp]), x = c (x_fixed, x_nbinom, x_nbinom (tdf) , Plot (x, y, tomorrow =), type = c (rep (c ('fixed', 'nbi ('Real', 6)), pch = 19, log = 'xy'))
I think this question is a bit old but I had a similar problem and resolved it using information in this post:
My solution for the base 1 here is 0 log-scaled stacked area chart, this should not be very different for scatter plots.
df < -data.frame (x = rep (10 ^ seq (0,5, length) .out = 24), each = 4), y = round (ranif (4 * 24,1,50)), var = representative ( Liter [1: 4], 4)) DF $ x & lt; -log (df $ X, 10) p & lt; - nPlot (y = x, group = 'var', data = df, type = 'stacked array' ', id =' chart ') p $ xAxis (tickFormat = "#! Function (x) {ticket format = [1,10,100, 1000,10000, '100k']; Return Ticket [x];}! # ") P
Comments
Post a Comment