scatter-plot

How to change background color for scatter plot in matplotlib

旧城冷巷雨未停 提交于 2019-12-08 06:40:20
问题 How do I change the background color of a scatter plot in matplotlib? Currently I have import matplotlib.pyplot as plt plt.scatter(X, Y, c=T, marker='o', s=(0.005*r), linewidth=0, cmap=cm.coolwarm) plt.scatter(X_stars, Y_stars, marker='o', s=(0.00000005*r), color='white') plt.savefig(filename, format='ps') I want the background to be black, not white. I already changed facecolor and edgecolor to black, but without the desired effect. Setting transparent=True made it transparent so that I

ggplot2 2D Density plot - the gradient fill is too smooth

泄露秘密 提交于 2019-12-08 05:24:49
问题 I am having some difficulty with the ggplot2 package and the gradient fill. For my data with low number of data points, its gradient and density intensity doesn't really match. Here is an example: The code I am using is: pt <- read.xlsx("plots.xlsx", sheetName = "PT1_TB varseq", stringsAsFactors=FALSE) ggplot(pt, aes(x=pt$BAF, y=pt$LogR) ) + stat_density_2d(aes(fill = ..density..), geom = "raster", contour = FALSE) + scale_fill_distiller(palette= "Spectral", direction=-1) + scale_y_continuous

JFreeChart: How to plot a line graph and a scatter on same chart

谁说胖子不能爱 提交于 2019-12-07 17:47:35
问题 i have two sets of data int[] x1 = {1,2,3,4,5,6,7,8,9,10}; int[] y1 = {1,2,3,5,6,8,9,10,14,11}; int[] x2 = {1,2,3,4,5,6,7,8,9,10}; int[] y2 = {0,2,3,5,0,8,9,8,14,11}; int[] z2 = {1,2,3,1,2,3,1,2,3,1}; I want to plot the x1,y1 as an XYLineChart and then plot x2,y2 as a scatter on the same plot without a line. I also need each scatter point of xy,y2 to be a different color depending on the value of z2 (1=Color.red, 2=Color.green, 3=Color.blue) How can i do this? So far i have: JPanel panel_1 =

Align matplotlib scatter marker left and or right

风格不统一 提交于 2019-12-07 12:29:57
问题 I am using the matplotlib scatterplot function to create the appearance of handles on vertical lines to delineate certain parts of a graph. However, in order to make them look correct, I need to be able to align the scatter plot marker to the left (for the left line / delineator) and / or right (for the right line / delineator). Here's an example: #create the figure fig = plt.figure(facecolor = '#f3f3f3', figsize = (11.5, 6)) ax = plt. ax = plt.subplot2grid((1, 1), (0,0)) #make some random

Contour plot from scattered data in JavaScript [closed]

拥有回忆 提交于 2019-12-07 12:21:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm trying to plot a 2D and 3D contour from x, y, z data. Does anyone know any good JavaScript library that does that? Thank you 回答1: This question is very similar to another question that was already asked and answered at Create contour map In that post, it was recommended to use d3.js and conrec.js. 来源: https:

How to create a 3D scatter plot?

百般思念 提交于 2019-12-07 10:06:56
问题 I have been doing some research on 3d scatter plots with C#. So far I have found a library that is somewhat working for me. However, not necessarily as flexible as I need it to be. Since all I require is to create a fixed 3D scatter plot, are there other alternatives to 3d plotting using the Point3D structure in C# or any other alternatives that don't require me bringing in a 3rd party library and that might allow for better flexibility? 回答1: I've managed to create a 3D scatter plot with

Add legend to scatter plot

╄→尐↘猪︶ㄣ 提交于 2019-12-07 06:35:08
问题 This question has been asked on SO, but I want to find a clearer solution. Given X is 100x2 data, and labels is the label vector ( from 1 to 9) I plot the scatter plot as following: pl.scatter(X[:,0], X[:,1], c = labels) pl.show() How to add legend to explain the colors in just one line of code? Other solutions plot each label separately: a = pl.scatter(X1[:,0], X1[:,1], color = "red") b = pl.scatter(X2[:,0], X2[:,1], color = "green") c = pl.scatter(X3[:,0], X3[:,1], color = "blue") pl.legend

Scatter pie plot

[亡魂溺海] 提交于 2019-12-06 08:57:05
问题 I'm trying to visualize a soft clustering. There are a number of points and a small number of clusters, each point belongs to each cluster with some probability. Currently, I'm overlaying a scatterplot for each cluster, with the size of 'o' markers varying by the probability. This allows easy identification of the most probable cluster, but not much beyond that. I'd like to draw a scatterplot of pie charts, i.e. one small pie chart for each of the many data points, showing these probabilities

3d scatterplot in R using rgl plot3d - different size for each data point?

我只是一个虾纸丫 提交于 2019-12-06 07:52:42
问题 I am using plot3d(x,y,z, col=test$color, size=4) to plot a 3d scatterplot of my dataset with R, but with rgl the size argument only takes one size. Is it possible to have different sizes for each data point, perhaps with another library, or is there a simple workaround? Thanks for your ideas! 回答1: Here's a work-around along the same lines suggested by Etienne. The key idea is to set up the plot, then use a separate call to points3d() to plot the points in each size class. # Break data.frame

Scatter Plot 3D for Web Application

半城伤御伤魂 提交于 2019-12-06 05:02:36
I am looking for a Scatter Plot 3D component for a Web application. Right now I am using JMathPlot (inside a Java Applet) to produce something like this: alt text http://jmathtools.berlios.de/lib/exe/fetch.php?media=scatterplot3d.png JMathPlot is fine, but is missing some required functionality (I am especially interested in having tooltips for the plot points). Are there any alternatives? Any interactive web technology (javascript, java applet, flash, silverlight) is fine. The user should be able to rotate/zoom the plot and see the tooltips, when hovering the mouse over a point. There are