scatter-plot

How to customize marker colors and shapes in scatter plot?

杀马特。学长 韩版系。学妹 提交于 2019-12-06 03:48:22
I have a data set with 9 columns. 7 features are used for feature selection and one of them for the classification. I used tsne library for feature selection in order to see how much my data could be classified.The result from tsne is shown in picture. However, I want to visualize my data in another way. I would like to set a color for each observation based on the column f1 (id). for example : f1(id) f2 f3 ... f9(class label) 1 66 77 ... A 1 44 88 ... A 2 33 55 ... B 2 77 88 .. B colors come from f1 and shapes come from f9 . I do not know how to do it! I would appreciate for your comments or

Change point colour based on value for Google Scatter Chart

怎甘沉沦 提交于 2019-12-06 03:37:35
问题 I am creating a Google scatter chart. I have one data series which looks something like: var data = new google.visualization.DataTable(); data.addColumn('number', 'ID'); data.addColumn('number', 'Value'); data.addRows([[1,100], [2,150], [3,200], [4,250], [5,300], [6,350], [7,400], [8,450]]); I want the colour of the points on the scatter chart to vary, between green and red, based on the 'Value' of each point. i.e. the colour of point ID=1 should be green, however ID=8 should be red! Is this

Determine which points lay outside an irregularly-shaped data footprint in R?

末鹿安然 提交于 2019-12-06 03:32:45
问题 I have a series of points in an area whose 'footprint' shape is highly irregular: I'd like to determine all of the coordinates within the footprint's vertices. The end goal is to determine which data points lay outside this footprint. Does anyone have an efficient way to go about doing this?? My best idea to approaching this is to draw a polygon based on the green area's vertices and then use said polygon's coordinates to determine 'outlier' points' (though, I'm not sure how to do that yet --

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

我只是一个虾纸丫 提交于 2019-12-06 02:59:18
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 = new JPanel(); panel_1.setLayout(new BorderLayout(0, 0)); XYSeriesCollection dataset = new

Scatter plot with multiple markers

你离开我真会死。 提交于 2019-12-05 22:11:24
I am trying to put a scatter plot together from multiple data files, to see how the correlate to each other. The code looks like this: hold all fia = fopen('data.txt'); A = fscanf(fia, '%f %f %f', [3 inf]); t = A(1,:); a = A(2,:); r = A(3,:); figure(1) scatter(log(r),log(a),'r', '-'); fclose(fia); fia = fopen('data.txt'); A = fscanf(fia, '%f %f %f', [3 inf]); t = A(1,:); a = A(2,:); r = A(3,:); figure(2); scatter(log(r),log(a), 'g', '-'); fclose(fia); And so on, where the next data points are plotted on the same graph: fia = fopen('data.txt'); A = fscanf(fia, '%f %f %f', [3 inf]); t = A(1,:);

Color code a scatter plot by group with a gradient

痞子三分冷 提交于 2019-12-05 21:44:10
I have XY data which I'd like to graph using a scatter plot , with R 's plotly package. set.seed(1) df <- data.frame(x=c(rnorm(30,1,1),rnorm(30,5,1),rnorm(30,9,1)), y=c(rnorm(30,1,1),rnorm(30,5,1),rnorm(30,9,1)), group=c(rep("A",30),rep("B",30),rep("C",30)),score=runif(90,0,1)) Each point is assigned to one of three groups ( df$group ) and has a score in the [0,1] range. I'm looking for a way to graph the data such that each group is colored with a different color but the shade of that color (or intensity) reflects the score. So I thought this would work: library(dplyr) library(plotly) plot_ly

Contour plot from scattered data in JavaScript [closed]

﹥>﹥吖頭↗ 提交于 2019-12-05 18:25:50
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 jluckin 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://stackoverflow.com/questions/24127518/contour-plot-from-scattered-data-in-javascript

Align matplotlib scatter marker left and or right

别等时光非礼了梦想. 提交于 2019-12-05 16:09:11
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 data index = pandas.DatetimeIndex(start = '01/01/2000', freq = 'b', periods = 100) rand_levels = pandas

How to create a 3D scatter plot?

北城以北 提交于 2019-12-05 15:26:50
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? I've managed to create a 3D scatter plot with ILNumerics : var colors = new[] { Color.Red, Color.Black, Color.Blue, Color.Green /*...*/ }; ILArray<float> data

Plotting circles with no fill, colour & size depending on variables using scatter

老子叫甜甜 提交于 2019-12-05 06:35:29
The information I have to show on a plot are 2 coordinates: size & colour (no fill). The colour is important as I need a colormap type of graph to display the information depending on a colour value. I went about trying two different ways of doing this: Create specific circles and add the individual circles. circle1 = plt.Circle(x, y, size, color='black', fill=False) ax.add_artist(circle1) The problem with this method was that I could not find a way to set the colour depending on a colour value. i.e. for a value range of 0-1, I want 0 to be fully blue while 1 to be fully red hence in between