scatter-plot

Issue in setting the background color in pyqtgraph

只愿长相守 提交于 2019-12-10 20:39:42
问题 I've got an issue when using the pyqtgraph module in python. When I put a white background color to a glscatterplot, the scatter dots just vanish. It is like if the color of background was added to the color of the scatterplot therefore everything is white. Here is a piece of the code I use: w = gl.GLViewWidget() w.setBackgroundColor('w') w.show() sp3 = gl.GLScatterPlotItem(pos=np.transpose(pos3), color=rgba_img, size=1, pxMode=False) w.addItem(sp3) If I replace ('w') by ('k') in the

How to clone X and Y axis?

非 Y 不嫁゛ 提交于 2019-12-10 20:14:06
问题 I have a barChart with overplot a lineChart, two different series barChart.getData().addAll(series1); lineChart.getData().addAll(series2); My question: is it possible, and how to, clone barChart axis so to get the same settings for lineChart? What I would like to have is a perfect axis settings overlapping. Thanks Edit: at this link axis clone method I see there is a clone method Methods inherited from class java.lang.Object How can I use this method? Thanks all Edit2: below is a sample class

Invalid rgba arg “#” in matplotlib

て烟熏妆下的殇ゞ 提交于 2019-12-10 18:29:24
问题 I can't figure out how to use colours while trying to create a scatter plot in matplotlib. I'm trying to plot multiple scatter plots with different colour points to show the clusters. colors=['#12efff','#eee111','#eee00f','#e00fff','#123456','#abc222','#000000','#123fff','#1eff1f','#2edf4f','#2eaf9f','#22222f' '#eeeff1','#eee112','#00ef00','#aa0000','#0000aa','#000999','#32efff','#23ef68','#2e3f56','#7eef1f','#eeef11'] C=1 fig = plt.figure() ax = fig.gca(projection='3d') for fgroups in groups

Increasing scatter points marker size from a .fig file

喜夏-厌秋 提交于 2019-12-10 17:52:25
问题 I have a figure file (scatter.fig) . This figure has many scatter points plotter using scatter(). Now i just have this fig file, I need to increase the marker size of all scatter points. Tried it manually but its very difficult. Is there a way i can do something like H=figurehandle() s= points(h) set(s,'markersize'); I just could not figure out the exact commands. Thanks. 回答1: You need to get a handle to the scattergroup object to change the marker properties. As proposed by Jonas in a

Logarithmic grid for plot with 'ggplot2'

左心房为你撑大大i 提交于 2019-12-10 17:39:06
问题 I am trying to create a plot with logarithmically spaced grids using ggplot2 just like in the below figure. I get equidistant grids, but not log spaced ones. I know I am missing some parameter which I don't seem to get as of now. I have seen a lot of questions on the topic like Pretty ticks for log normal scale using ggplot2 (dynamic not manual), but do not solve the problem I am looking for. set.seed(5) x <- rlnorm(1000, meanlog=3.5, sdlog=1) y <- rlnorm(1000, meanlog=4.0, sdlog=1) d <- data

Updating the positions and colors of pyplot.scatter

老子叫甜甜 提交于 2019-12-10 17:32:58
问题 I have been struggling with this for a while and can't get it to work. I am reading a file in chunks and scatter plotting data from it, and I would like to "animate" it by updating the scatter plot for each chunk in a for loop (and also adapt it to a live stream of data). So something like this ugly example works for a single plot: x = [1, 2, 3, 4] y = [4, 3, 2, 1] alpha = [0.2, 0.3, 0.8, 1.0] c = np.asarray([(0, 0, 1, a) for a in alpha]) s = scatter(x, y, marker='o', color=c, edgecolors=c)

Highcharts Symbol in Legend

泄露秘密 提交于 2019-12-10 16:27:19
问题 I have a highcharts legend where the symbols are displaying with varying sizes as they are different sizes in the actual chart. Unfortunately, when the sizes of the data points grow, they also grow in the legend. I want the legend symbols to remain the same size regardless of the data point size. Here is an example where the data points have grown with the graph. In case it matters, the actual graph I'm using is a scatter plot (unlike the example). http://jsfiddle.net/RsUhk/ Any help is much

Saving scatterplot animations with matplotlib

偶尔善良 提交于 2019-12-10 14:54:57
问题 I've been trying to save an animated scatterplot with matplotlib, and I would prefer that it didn't require totally different code for viewing as an animated figure and for saving a copy. The figure shows all the datapoints perfectly after the save completes. This code is a modified version of Giggi's on Animating 3d scatterplot in matplotlib, with a fix for the colors from Yann's answer on Matplotlib 3D scatter color lost after redraw (because colors will be important on my video, so I want

Issue with Matplotlib scatterplot and Color maps

牧云@^-^@ 提交于 2019-12-10 14:53:26
问题 I am working on a project that involves applying colormaps to scatterplots generated in matplotlib. My code works as expected, unless the scatterplot being generated has exactly four points. This is illustrated in the following code: import numpy as np import matplotlib.pyplot as plt cmap = plt.get_cmap('rainbow_r') z = np.arange(20) plt.close() plt.figure(figsize=[8,6]) for i in range(1,11): x = np.arange(i) y = np.zeros(i) + i plt.scatter(x, y, c=cmap(i / 10), edgecolor='k', label=i, s=200)

Seaborn Jointplot add colors for each class

懵懂的女人 提交于 2019-12-10 14:09:57
问题 I want to plot the correlation plot of 2 variables using seaborn jointplot . I have tried a lot of different things but I am not able to add colors to the points according to class. Here is my code: import numpy as np import seaborn as sns import matplotlib.pyplot as plt sns.set() X = np.array([5.2945 , 3.6013 , 3.9675 , 5.1602 , 4.1903 , 4.4995 , 4.5234 , 4.6618 , 0.76131, 0.42036, 0.71092, 0.60899, 0.66451, 0.55388, 0.63863, 0.62504, 0. , 0. , 0.49364, 0.44828, 0.43066, 0.57368, 0. , 0. , 0