Questions tagged [scatter-plot]

A scatter plot is a type of data visualization that reveals possible correlations between two variables. Data points are plotted on a two-dimensional plane using Cartesian coordinates. Use this tag if you have a programming question related to scatter plots, such as problems with computing or displaying the data. You should also tag which language or software libraries you are using.

A scatter plot is a type of mathematical diagram that reveals possible correlations between two variables. Data points are plotted on a two-dimensional plane using Cartesian coordinates. Series of points may be colorized to display additional data.

Link:

3562 questions
8
votes
2 answers

Line of best fit scatter plot

I'm trying to do a scatter plot with a line of best fit in matlab, I can get a scatter plot using either scatter(x1,x2) or scatterplot(x1,x2) but the basic fitting option is shadowed out and lsline returns the error 'No allowed line types found.…
Jon
  • 141
  • 1
  • 1
  • 5
8
votes
2 answers

Two plots with same X and Y axis

The plot shown is produced by the following R code. png("test.png") plot(data[,4],data[,3],type='l',col="green") par(new=TRUE) plot(data[,4],data[,2],type='l',col="red") dev.off() The range of Y-axis differs for both the plots and it is overwritten…
chas
  • 1,565
  • 5
  • 26
  • 54
8
votes
5 answers

Plot 95% confidence limits in scatterplot

I need to plot several data points that are defined as c(x,y, stdev_x, stdev_y) as a scatter plot with a representation of their 95% confidence limits, for examples showing the point and one contour around it. Ideally I'd like to plot on oval…
7
votes
1 answer

How to remove specific part of legend (seaborn, scatterplot)

I am using a seaborn scatterplot and just started using different point sizes. sns.scatterplot(x='X [um]', y='Y [um]', hue='label', size='size', data=data) All works perfectly but I'd like to remove the 'size' from the legend seen in picture: The…
Benjamin Jabl
  • 231
  • 2
  • 7
7
votes
2 answers

Matplotlib how to draw vertical line between two Y points

I have 2 y points for each x points. I can draw the plot with this code: import matplotlib.pyplot as plt x = [0, 2, 4, 6] y = [(1, 5), (1, 3), (2, 4), (2, 7)] plt.plot(x, [i for (i,j) in y], 'rs', markersize = 4) plt.plot(x, [j for (i,j) in y],…
iso_9001_
  • 2,655
  • 6
  • 31
  • 47
7
votes
2 answers

Change legend location and labels in Seaborn scatter plot

I am tying to change the location as well as labels of my legend in Seaborn scatterplot. Here is my code: ax_total_message_ratio=sns.scatterplot(x='total_messages',…
jay
  • 1,319
  • 6
  • 23
  • 42
7
votes
2 answers

Why and when "Using size for a discrete variable is not advised"?

I made a scatterplot with ggplot2 and I mapped a binary variable to point size. The result was satisfactory but I got the warning "Using size for a discrete variable is not advised". I understand that using size to map a non ordinal categorical…
Pere
  • 706
  • 1
  • 7
  • 21
7
votes
2 answers

scatterplot3d: regression plane with residuals

Using scatterplot3d in R, I'm trying to draw red lines from the observations to the regression plane: wh <- iris$Species != "setosa" x <- iris$Sepal.Width[wh] y <- iris$Sepal.Length[wh] z <- iris$Petal.Width[wh] df <- data.frame(x, y, z) LM <-…
Frans Rodenburg
  • 476
  • 6
  • 17
7
votes
1 answer

Conditional color with matplotlib scatter

I have the following Pandas Dataframe, where column a represents a dummy variable: What I would like to do is to give my markers a cmap='jet' color following the value of column b, except when the value in column a is equal to 1 - in this case I…
MattnDo
  • 444
  • 1
  • 5
  • 17
7
votes
1 answer

how to make a scatter plots using tensorboard - tensorflow

now, i'm studying tensorflow. but, i can't draw dot graph using tensorboard. if i have sample data for training, like that train_X = numpy.asarray([3.3, 4.4, 5.5, 6.71, 6.93, 4.168, 9.779]) train_Y = numpy.asarray([1.7, 2.76, 2.09, 3.19, 1.694,…
jaewan Shin
  • 71
  • 1
  • 2
7
votes
3 answers

MATLAB scatter3, plot3 speed discrepencies

This is about how MATLAB can take very different times to plot the same thing — and why. I generate 10000 points in 3D space: X = rand(10000, 1); Y = rand(10000, 1); Z = rand(10000, 1); I then used one of four different methods to plot this, to…
Bill Cheatham
  • 11,396
  • 17
  • 69
  • 104
7
votes
3 answers

R plotly version 4.5.2 scatterplot legend bubble size settings

I am using plotly 4.5.2 in R. I have created a scatterplot which is sized on a variable, the issue is these sizes are also reflected in the legend which makes them hard to read. I want my graph to remain the same, with the only exception being the…
ZeroStack
  • 1,049
  • 1
  • 13
  • 25
7
votes
1 answer

R/ggplot2: Collapse or remove segment of y-axis from scatter-plot

I'm trying to make a scatter plot in R with ggplot2, where the middle of the y-axis is collapsed or removed, because there is no data there. I did it in photoshop below, but is there a way to create a similar plot with ggplot? This is the data with…
Jon
  • 373
  • 5
  • 15
7
votes
1 answer

scatter plot with aligned annotations at each data point

I want to produce a scatter plot with dozens of points, which could potentially be very close to each other. I've tried the method of annotation from the answer to the question: >> matplotlib scatter plot with different text at each data point but…
ellockie
  • 3,730
  • 6
  • 42
  • 44
7
votes
1 answer

R: Add a curve,with my own equation, to an x,y scatterplot

I want to add a curve with the following equation to an x,y scatterplot: y<-(105+0.043(x^2-54x)). Is it possible within the plot() function? Also, if I use qplot instead (ggplot2) is there a way to draw this curve?
user4631839
  • 83
  • 1
  • 2
  • 9