Improve performance with 3K point on scatter chart - javafx

I was doing tests on a scatter chart in java fx, I saw that with 2000 points it takes a few seconds. How can I optimize performance?
I have a chart with on the y-axis numbers, while in x it has strings
I was trying to use a canvas above the chart to draw, but I wanted to know if you know any better way

Related

Jump y axis values when highest value is to far away from the other points

Basically I'm building an area graph with Chart.js, the data that I'm using in order to build the graph usually contains a peak that is much higher than the rest of the points and the y-axis range of values will be to high, to notice the diference between the lower points and it wil seem almost as a parallel line to the x-axis as we can see in this image:
Graph with problems
The solution I want to try is to skip the values from the y-axis between the lower points and the peak of the graph, and accomplish a graph presentation similar to this one:
Solution graph sketch
As we can see at this sketch the y-axis has a normal scale until 300 but then as the next point is to far away from the other ones the y-axis values are skiped.
So what I want to know is if this jump on the values of the y-axis is possible to achieve with this library (Chart.js) and if so where can I find documentation about it, because I already looked everywhere and couldn't find a thing. If not I would ask you for recommendations of any other librarys where I could achieve this.

R shiny r-markdown: synchronize zoom in charts

I am creating a flexdashboard with R markdown / shiny.
Assumed the dashboard has two identical scatter plots. Is there a way to synchronize the two charts, if I zoom into one of them? Which is the best package to achieve this and to have it on the flexdashboard?
I tried Plotly. But there I could only synchronize one axis, but not both at the same time. If the charts are vertically oriented it would synchronize the x axis, and if horizontally oriented it would synchronize the y axis.
I am still trying dygraph. I have the impression by grouping the charts, I might be able to synchronize the zoom. Is that right? Would it synchronize both axis at the same time? (Only problem, this is mainly a time series tool, and not meant for scatter plots, i.e. not for data with more than one value per x value. At least this is my impression.)
Is there a package able to handle x and y axis synchronization at the same time? Or did I miss anything with Plotly/dygraph?
Thanks for your help.
For those interested. Rbokeh does scatterplots and allows synchronizing both axes. Use the grid_plot function to plot your charts and set same_axes = TRUE.
dygraphs synchronizes only the date range (x axis), if you set the parameter group. To synchronize the y axis you can try to get the zoom callback and to apply the zoom level to the other plot.

Making a 'flip-book' type animation using density plots from R

I'm new to R, but have worked out how to graph the distribution of my students' grades for a given term using a density plot, and have made some ridgeline plots to show how the distribution evolves throughout the academic year.
I'm thinking it might be fun (and make the graphs easier to interpret) if I could make a kind of flip-book animation that went from one terms grades to the next, relatively quickly, to see how the distribution changes. At its simplest, I could just pop these distribution plots into Powerpoint and just scroll through the pages, but I'm wondering what commands I need to put into R's ggplot command to ensure that the axes/scaling from one chart to the next stays consistent from one chart to the next?
At the moment, I'm just making a simple chart using this command, where HT102 is the data from the 2nd term of Year 10, and A8 is a vector containing all the (numeric) grades. I am then doing the same thing with another set of grades called ht103, and so on...
ggplot(ht102, aes(x = A8)) +
geom_density(alpha=.3)
What would you recommend to keep the scaling consistent, and any thoughts on a better way to animate this than just popping them into powerpoint?

R barplot, bar size = x axis * y axis?

In R,
is it possible to get the barplot (or whatever the name of this type plot is), that the size of each bar area = value of x axis * value of y axis.
Thanks.
==============================
updated:
Actually I am trying to make a chart to show the performance (speed+accuracy) of the tools I was testing. There are 7 small plot in a panel. That gives some sort of overview, of course there are more detailed plots just for speed and accuracy for each tool.
In the plot, some symbols (15 symbols in total) overlapped each other, so it could be hard for the reader to find out which are the symbols behind the others.
And that was the reason I am seeking other ways of doing this.
A also did a bubble plot for the performance (green: accuracy, red: speed), this is only a initial version of it, but still, it doesn't look OK.

R: How to overlay pie charts on 'dots' in a scatterplot in R

Using R I would like to replace the points in a 2d scatter plot by a pie chart displaying additional values.
The rational behind is that I have time series data for hundreds of elements (proteins) derived from a biological experiment monitored for 4 conditions. I would like to plot the elements (categorial data) on the y axis and occurrence of a event in time on the x axis. To visualize the relative occurrence between the 4 conditions I would like to visualize this in form of a pie chart or doughnut chart overplayed onto the respective point in the scatter plot.
The overall data density is low so overlapping won't be an issue.
Is this possible in R?
I was thinking of using a manual scale in ggplot2 but could not figure out how to define a pie chart as a scale.
Also of interest would be how to best cluster this data and sort it accordingly.
Yes. pieGlyph() is one ready-to-go function from the Rgraphviz package.
Also, I would check out this Q/A for how to do things like this more generally:
How to fill a single 'pch' point on the plot with two-colours?
Especially check out ?my.symbols from the TeachingDemos package.
Lastly, in regards to ggplot2, you should check out this blog post about possible upcoming features:
http://blog.revolutionanalytics.com/2011/10/ggplot2-for-big-data.html
See also Paul Murrell. Integrating grid graphics output with base graphics output. R News, 3(2):7-12, October 2003. http://www.r-project.org/doc/Rnews/Rnews_2003-2.pdf
The code on pp 10-11 sets up the main plot axes, labels and legend, and then opens a series of smaller windows centered at each individual point on the plot and plots a small graph in each window. I've tried pie charts, mosaics and barplots, but the method is not limited to these types.

Resources