scatter-plot

Is there a function to make scatterplot matrices in matplotlib?

戏子无情 提交于 2019-11-27 03:00:54
Example of scatterplot matrix Is there such a function in matplotlib.pyplot? Generally speaking, matplotlib doesn't usually contain plotting functions that operate on more than one axes object (subplot, in this case). The expectation is that you'd write a simple function to string things together however you'd like. I'm not quite sure what your data looks like, but it's quite simple to just build a function to do this from scratch. If you're always going to be working with structured or rec arrays, then you can simplify this a touch. (i.e. There's always a name associated with each data series

pylab 3d scatter plots with 2d projections of plotted data

跟風遠走 提交于 2019-11-27 02:25:54
问题 I am trying to create a simple 3D scatter plot but I want to also show a 2D projection of this data on the same figure. This would allow to show a correlation between two of those 3 variables that might be hard to see in a 3D plot. I remember seeing this somewhere before but was not able to find it again. Here is some toy example: x= np.random.random(100) y= np.random.random(100) z= sin(x**2+y**2) fig= figure() ax= fig.add_subplot(111, projection= '3d') ax.scatter(x,y,z) 回答1: You can add 2D

creating a matplotlib scatter legend size related

别说谁变了你拦得住时间么 提交于 2019-11-27 01:39:23
问题 I am looking for a way to include a (matplotlib) legend that describe the size of points in a scatter plot, as this could be related to another variable, like in this basic example: import numpy as np import matplotlib.pyplot as plt N = 50 x = np.random.rand(N) y = np.random.rand(N) a2 = 400*np.random.rand(N) plt.scatter(x, y, s=a2, alpha=0.5) plt.show() (inspired from: http://matplotlib.org/examples/shapes_and_collections/scatter_demo.html) so in the legend there would be ideally few spots

How to do a scatter plot with empty circles in Python?

巧了我就是萌 提交于 2019-11-26 23:50:59
问题 In Python, with Matplotlib, how can a scatter plot with empty circles be plotted? The goal is to draw empty circles around some of the colored disks already plotted by scatter() , so as to highlight them, ideally without having to redraw the colored circles. I tried facecolors=None , to no avail. 回答1: From the documentation for scatter: Optional kwargs control the Collection properties; in particular: edgecolors: The string ‘none’ to plot faces with no outlines facecolors: The string ‘none’

Why doesn't the color of the points in a scatter plot match the color of the points in the corresponding legend?

£可爱£侵袭症+ 提交于 2019-11-26 23:41:46
问题 I have a sample scatterplot via matplotlib via the code below. import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 100, 501) y = np.sin(x) label = 'xy data sample' plt.scatter(x, y, cmap='plasma', c=x, label=label) legend_dict = dict(ncol=1, loc='best', scatterpoints=4, fancybox=True, shadow=True) plt.legend(**legend_dict) plt.show() Running the code above produces the plot below. The colormap was successfully plotted, but the legend shows points that are all blue rather

car::scatter3d in R - labeling axis better

被刻印的时光 ゝ 提交于 2019-11-26 23:21:35
问题 I'm using scatter3d and the 3 axes just have two endpoint values. how can I get labels throughout the entire axis, just like the normal plot() function does? 回答1: Oh well. I took it as a challenge. Obviously you need to: require(rgl) require(car) require(mgcv) # for the example Copy the car:::scatter3d.default code and paste it back, assigning it to scatter3d.default . Add these lines early in the code for scatter3d.default : showLabels3d <- car:::showLabels3d nice <- car:::nice # since you

Control the size of points in an R scatterplot?

你说的曾经没有我的故事 提交于 2019-11-26 22:34:52
问题 In R, the plot() function takes a pch argument that controls the appearance of the points in the plot. I'm making scatterplots with tens of thousands of points and prefer a small, but not too small dot. Basically, I find pch='.' to be too small, but pch=19 to be too fat. Is there something in the middle or some way to scale the dots down somehow? 回答1: Try the cex argument: ?par cex A numerical value giving the amount by which plotting text and symbols should be magnified relative to the

scatter plot in jfreechart from database

假如想象 提交于 2019-11-26 22:26:31
问题 How can i draw scatter plot of datas in mysql database table using jfreechart in java. I have used swing library. Any link would be helpful. I searched google but couldnot find a understanding solution. If you have got code just provide me. Actually i did do barchart and plot it using jfreechart. The code i used for my barchart is here. Here display3 function displays the barchart. How can i modify it to display scatter plot? public void display3() throws SQLException, ClassNotFoundException{

3D scatter plot with 4D data

偶尔善良 提交于 2019-11-26 22:12:34
问题 I need to plot a 3D figure with each data point colored with the value of a 4th variable using a colormap. Lets say I have 4 variables X,Y,Z and W where W = f(X,Y,Z). I want a 3D plot with X, Y, and Z as the three axis. The statement scatter3(X,Y,Z,'filled','b') gives me a scatter plot in 3D but I want to incorporate the value of Z in the graph by representing the points as an extra parameter (either with different areas :bigger circles for data points with high value of Z and small circles

Matplotlib scatter plot legend

柔情痞子 提交于 2019-11-26 15:59:52
I created a 4D scatter plot graph to represent different temperatures in a specific area. When I create the legend, the legend shows the correct symbol and color but adds a line through it. The code I'm using is: colors=['b', 'c', 'y', 'm', 'r'] lo = plt.Line2D(range(10), range(10), marker='x', color=colors[0]) ll = plt.Line2D(range(10), range(10), marker='o', color=colors[0]) l = plt.Line2D(range(10), range(10), marker='o',color=colors[1]) a = plt.Line2D(range(10), range(10), marker='o',color=colors[2]) h = plt.Line2D(range(10), range(10), marker='o',color=colors[3]) hh = plt.Line2D(range(10)