scatter-plot

Best way to draw scatter plot with lots of data points in C++ using OpenGL

笑着哭i 提交于 2019-12-04 07:47:34
I'm writing a program in C++ that acquires 4 dimensional points data over a UDP socket and then plots the data in 6 separate 2D scatter plots. For example if we name the dimensions: A,B,C,D the six 2d plots would be AxB, AxC, AxD, BxC, BxD, and CxD. Over the course of a few hours the program accrues ~50K points. Currently I plot each point once, using immediate mode. I don't clear the buffer between draw calls so previously plotted points persist until the buffer is cleared. I'm not happy with this method as immediate mode is slow and deprecated. When I have to clear the buffer, as when a

Plotting with pandas and matplotlib

大兔子大兔子 提交于 2019-12-04 06:10:14
问题 I'm trying to create a scatter plot in Python. I have a dataframe 'df' with a specified category and x and y are column numbers: groups = df.groupby(category) fig, ax = plt.subplots() for name, group in groups: ax.plot(x=group.iloc[:,x], y=group.iloc[:,y], marker='o', linestyle='',label=name) fig = ax.get_figure() fig.savefig(path) For some reason, I am getting an empty scatterplot -- Am I doing something wrong? 回答1: ax.plot does not have x and y arguments. The signature is Axes.plot(*args, *

creating legend for scatter3 plot (Matlab)

对着背影说爱祢 提交于 2019-12-04 03:55:06
问题 I have a matrix points X in 3 dimensions ( X is a Nx3 matrix) and those points belong to clusters. The cluster it belongs is given by the Nx1 vector Cluster (it has values like 1,2,3,...). So, I am plotting it on scatter3 like this: scatter3(X(:,1),X(:,2),X(:,3),15,Cluster) It works fine, but I would like to add a legend to it, showing the colored markers and the cluster it represents. For example, if i have 3 clusters, I would like to have a legend like: <blue o> - Cluster 1 <red o> -

Using colormap with bokeh scatter

≯℡__Kan透↙ 提交于 2019-12-03 17:38:58
问题 In matplotlib the scatterplot offers the possibility of using the color of a plot to indicate value or magnitude like this plot: For bokeh , similar examples seem to manually generate the rgb colors, which makes it difficult to produce plots with color scaled by magnitude, esp. wrt. diverging colormaps. Is it possible to have similar functionality in bokeh , or to use matplotlib colormaps to set the color? 回答1: It's easy enough to just use matplotlib 's colormaps directly. For example, the

Good Scatter-plot plugin for JQuery (sample pic included)?

血红的双手。 提交于 2019-12-03 14:54:45
I'm looking for a solid graphing plugin for JQuery that can give me an attractive scatterplot for use on my site. I really don't need a lot of fancy functionality -- just the ability to plot points on a graph based on the X-axis and Y-axis values I give it. The only somewhat peculiar requirement I have is that the dots have the ability to be different colors. In addition to tracking the item's "State" on the X-Axis, and it's "Input Time" on the Y-Axix, I want to represent it's "Status" (not to be confused with "State") by the actual color of the dot. Incidentally, there are 5 States, and 5

R - add centroids to scatter plot

社会主义新天地 提交于 2019-12-03 14:46:53
问题 I have a dataset two continuous variables and one factor variable (two classes). I want to create a scatterplot with two centroids (one for each class) that includes error bars in R. The centroids should be positioned at the mean values for x and y for each class. I can easily create the scatter plot using ggplot2, but I can't figure out how to add the centroids. Is it possible to do this using ggplot / qplot? Here is some example code: x <- c(1,2,3,4,5,2,3,5) y <- c(10,11,14,5,7,9,8,5) class

Matplotlib: Scatter Plot to Foreground on top of a Contour Plot

瘦欲@ 提交于 2019-12-03 10:37:13
问题 Does anyone know a way to bring a scatter plot to the foreground in matplotlib? I have to display the scatter plotting on top of the contour, but by default it is plotted underneath... Thanks in advance! 回答1: You can manually choose in which order the different plots are to be displayed with the zorder parameter of e.g. the scatter method. To demonstrate, see the code below, where the scatter plot in the left subplot has zorder=1 and in the right subplot it has zorder=-1 . The object with the

Visualization of scatter plots with overlapping points in matplotlib

有些话、适合烂在心里 提交于 2019-12-03 08:29:56
问题 I have to represent about 30,000 points in a scatter plot in matplotlib. These points belong to two different classes, so I want to depict them with different colors. I succeded in doing so, but there is an issue. The points overlap in many regions and the class that I depict for last will be visualized on top of the other one, hiding it. Furthermore, with the scatter plot is not possible to show how many points lie in each region. I have also tried to make a 2d histogram with histogram2d and

How do I create a categorical scatterplot in R like boxplots?

我的未来我决定 提交于 2019-12-03 08:00:02
Does anyone know how to create a scatterplot in R to create plots like these in PRISM's graphpad: I tried using boxplots but they don't display the data the way I want it. These column scatterplots that graphpad can generate show the data better for me. Any suggestions would be appreciated. csgillespie As @smillig mentioned, you can achieve this using ggplot2. The code below reproduces the plot that you are after pretty well - warning it is quite tricky. First load the ggplot2 package and generate some data: library(ggplot2) dd = data.frame(values=runif(21), type = c("Control", "Treated",

Excel XY Chart (Scatter plot) Data Label No Overlap

杀马特。学长 韩版系。学妹 提交于 2019-12-03 07:44:34
So I've been working on this for the past week. Although it can't do miracles, I can say I've got a pretty good result: I just wanted to put this code out there for all the poor souls like me that are looking for some kind of vba macro that helps them avoid label overlaps in a scatter plot, because while doing my research on the subject, I wasn't able to find anything helpful. Const PIXEL_TO_POINT_RATIO As Double = 0.72 '1 Pixel = 72/96*1 Point Const tStep As Double = 0.1 Const rStep As Double = 0.1 Dim pCount As Integer Sub ExampleMain() RearrangeScatterLabels Sheet5 RearrangeScatterLabels