scatter

pyplot scatter plot marker size

只愿长相守 提交于 2019-12-16 19:51:51
问题 In the pyplot document for scatter plot: matplotlib.pyplot.scatter(x, y, s=20, c='b', marker='o', cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, faceted=True, verts=None, hold=None, **kwargs) The marker size s: size in points^2. It is a scalar or an array of the same length as x and y. What kind of unit is points^2 ? What does it mean? Does s=100 mean 10 pixel x 10 pixel ? Basically I'm trying to make scatter plots with different marker sizes, and I want to figure

Matplotlib scatterplot error bars two data sets

假如想象 提交于 2019-12-14 04:23:14
问题 I have two data sets, which I'd like to scatter plot next to each other with error bars. Below is my code to plot one data set with error bars. And also the code to generate the second data set. I'd like the points and errors for each data for each value to be adjacent. I'd also like to remove the line connecting the dots. import random import matplotlib.pyplot as plt import numpy as np import scipy.stats as ss data = [] n = 100 m = 10 for i in xrange(m): d = [] for j in xrange(n): d.append

Pandas/Python/Matplotlib scatter plot markers colour depending on a value from a cell

亡梦爱人 提交于 2019-12-14 02:10:32
问题 I have been searching for solution on how to set points on a scatter plot depending on the value of a 'third' column. I could not find any ready-made solution, thus I have constructed my own, and I want to share it (maybe someone will make a use of it) :) If this is not a place to post it, then I am sorry and please remove it. Lets assume that there is a data frame 'scatterData' as below: lad2014_name Male Female Result 0 ABERDEEN CITY 95154 97421 -21.78 1 ABERDEENSHIRE 101875 105141 -13.10 2

Scatter does not plot any points on Basemap

自作多情 提交于 2019-12-13 17:33:49
问题 I have an array anomalies_ind that was created in this way: data_path = r"C:\Users\matth\Downloads\TRMM_3B42RT\3B42RT_Daily.201001.7.nc4" f = Dataset(data_path) latbounds = [ -45 , -10 ] lonbounds = [ 105, 160 ] lats = f.variables['lat'][:] lons = f.variables['lon'][:] # latitude lower and upper index latli = np.argmin( np.abs( lats - latbounds[0] ) ) latui = np.argmin( np.abs( lats - latbounds[1] ) ) # longitude lower and upper index lonli = np.argmin( np.abs( lons - lonbounds[0] ) ) lonui =

How can JFreeChart print a scatter point directly on the x axis?

北慕城南 提交于 2019-12-13 07:16:48
问题 I try to make a scatter chart but the data point is not exactly at the (2,0) coordinate and only partly visible. The image shows the generated output from JFreeChart: http://i.stack.imgur.com/oGpZW.png But it should be like this (made with GIMP): http://i.stack.imgur.com/dqrnh.jpg Does anybody know how to do it? thanks for any help!!! 回答1: For anybody else, here is the solution, which didn't satisfy me completely but is acceptable: http://i.stack.imgur.com/70TbB.png The interesting lines of

Scatter with 2 y-axes and datetick

心不动则不痛 提交于 2019-12-13 03:59:54
问题 I would really appreciate some help. I have to independent datasets. Each dataset contains two variables: dates (as datenumber) and corresponding data. I need to plot both datasets on one scatter plot with dates on x-axis and two y-axes. I have been trying with the following code: figure(1); scatter(x1,y1,'g'); set(gca); ax1=gca; set(ax1,'YColor','g'); ax2 = axes('Position',get(gca,'Position'),'YAxisLocation','right', XTick'[],'Color','none','YColor','r'); hold on; scatter(x2,y2,'r'); Now,

Multiindex scatter plot

∥☆過路亽.° 提交于 2019-12-12 18:56:52
问题 Suppose I have the following data: data = {'Value': {('1', 1): 3.0, ('1', 2): 4.0, ('1', 3): 51.0, ('1', 4): 10.0, ('1', 5): 2.0, ('1', 6): 17.0, ('1', 7): 14.0, ('1', 8): 7.0, ('1', 9): 2.0, ('1', 10): 1.0}} df=pd.DataFrame(data) Let's say this represents values for something for the first ten days in January. I want to plot this data, so I use: df.plot() plt.show() Now, suppose I have another data set that has values for a subset of these dates with slightly different values but the same

Add horizontal lines in categorical scatter plot using ggplot2 in R

我的梦境 提交于 2019-12-12 13:24:47
问题 I am trying to plot a simple scatter plot for 3 groups, with different horizontal lines (line segment) for each group: for instance a hline at 3 for group "a", a hline at 2.5 for group "b" and a hline at 6 for group "c". library(ggplot2) df <- data.frame(tt = rep(c("a","b","c"),40), val = round(rnorm(120, m = rep(c(4, 5, 7), each = 40)))) ggplot(df, aes(tt, val))+ geom_jitter(aes(tt, val), data = df, colour = I("red"), position = position_jitter(width = 0.05)) I really appreciate your help!

Beeswarm boxplot (scatterplot for categorical data) in MATLAB

我只是一个虾纸丫 提交于 2019-12-12 09:17:27
问题 I am looking for a function to create a so called Beeswarm boxplot. This is very popular plots used in medicine and biology and I was surprised not to find it for MATLAB. Basically the numerical data for each group are splitted to bins and jitter of points depends on number of points in a particular bin. Here is an example done with R using BEESWARM function: Different colors for additional group is very nice feature but it not needed for me now. 回答1: There is a function on the file exchange

Colouring scatter graph by type in r

拟墨画扇 提交于 2019-12-12 02:49:25
问题 Is there a way you can create a scatter graph in R and colour the points by a category? For example, I have a dataset with a list of x and y points (both columns 'Xpoints' and 'Ypoints' have scales from 0 to 100), but each combined x&y point belongs to one of five categories (in a third column 'Category'). I would like to plot all the combined x&y points AND colour each point by its respective category. I'm guessing that the five categories would have to allocated numbers 1 to 5 in an