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
21
votes
1 answer

How to disable legend in nvd3 or limit it's size

I'm using nvd3 and have a few charts where the legend is much to large. E.g. a scatter/bubble with 15 groups and the group names are long. The legend is so large that it leaves almost no room for the chart itself. Is there a way to remove the legend…
Dave Wilkin
  • 231
  • 1
  • 3
  • 13
21
votes
1 answer

Adding text labels to ggplot2 scatterplot

Is there a good way easy way to add text labels to the circles on the graph? I haven't able to do it using the directlabels package because I get the error: Error in direct.label.ggplot(p, "first.qp") : Need colour aesthetic to infer default direct…
Michael Discenza
  • 3,240
  • 7
  • 30
  • 41
20
votes
2 answers

How to rotate the 3D scatter plots in google colaboratory?

I am generating a 3d scatter plot in google colab, but the problem is that the generated fig is static and is not rotatable. I also tried the command %matplotlib notebook to enable the 3D scatter rotation as it apparently work in jupyter notebook…
19
votes
3 answers

Add points to the existing matplotlib scatter plot

How to add points to the existing diagram? The straightforward solution is to plot a new scatter, adding new data. ax.scatter(data[:,0], data[:,1], cmap = cmap, c = color_data) ax.scatter(new_points_x, new_points_y, color='blue') But if we want to…
toyewonug
  • 211
  • 1
  • 2
  • 5
19
votes
2 answers

How do parameters 'c' and 'cmap' behave?

For the pyplot.scatter(x,y,s,c....) function , The matplotlib docs states that : c : color, sequence, or sequence of color, optional, default: 'b' The marker color. Possible values: A single color format string. A sequence of color specifications…
Sagnik77Om
  • 307
  • 2
  • 4
  • 11
19
votes
3 answers

How to make scatterplot with geom_jitter plot reproducible?

I am using the Australian AIDS Survival Data. This time to create scatterplots. To show the genders in survival of different Reported transmission category (T.categ), I plot the chart in this way: data <-…
Mark K
  • 8,767
  • 14
  • 58
  • 118
19
votes
1 answer

Scatterplot: Error in FUN(X[[i]], ...) : object 'Group' not found

I'm trying to plot some data using ggplot and I'm having some problems with the significant lines and asterisk. This is the code I am using: p <- ggplot(Hematoxilin_tumor_necrosis, aes(x=total, y=necro, colour = Group))+ labs(y="Necrotic…
Tato14
  • 425
  • 1
  • 4
  • 9
18
votes
1 answer

matplotlib scatter fails with error: 'c' argument has n elements, which is not acceptable for use with 'x' with size n, 'y' with size n

I am trying to create a scatter plot using matplotlib where each point has a specific color value. I scale the values and then apply alpha blending between a 'left' and a 'right' color. # initialization from matplotlib import pyplot as plt from…
Burdui
  • 1,242
  • 2
  • 10
  • 24
18
votes
5 answers

Visualizing two or more data points where they overlap (ggplot R)

I have a scatterplot that has colour-coded data points. When two or more of the data points overlap only one of the colours is shown (whichever is first in the legend). Each of these data points represents an item and I need to show which items fall…
Cate
  • 189
  • 1
  • 1
  • 3
18
votes
3 answers

ggplot: colour points by groups based on user defined colours

I am trying to define the colours of groups of points plotted in ggplot. I adapted code from this post: Color ggplot points based on defined color codes but as soon as I have more than one row defined by the same grouping variable (rather than a…
user3267282
  • 181
  • 1
  • 1
  • 3
18
votes
5 answers

Transparency for Poly3DCollection plot in matplotlib

I am trying to draw some objects with the fabulous Matplotlib package for Python. These objects consist of points implemented with plt.scatter() and patches implemented with Poly3DCollection. I would like to have the patches with a slight…
Chilichiller
  • 477
  • 1
  • 5
  • 15
18
votes
1 answer

connecting points with lines in ggplot2 in r

Here is my data: mydata <- data.frame (grp = c( 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,2, 2, 2,2, 2, 2, 2, 2), grp1 = c("A", "A", "A", "A", "A", "B", "B", "B", "B" , "A", "A", "A", "A", "B", "B", "B", "B", "B"), namef =…
jon
  • 11,186
  • 19
  • 80
  • 132
18
votes
4 answers

Colormap for errorbars in x-y scatter plot

I have a time series of data for which I have the quantity, y, and its error, yerr. I would now like to create a plot that shows y against phase (i.e. time / period % 1) with vertical errorbars (yerr). For this, I typically use pyplot.errorbar(time,…
Random
  • 181
  • 1
  • 1
  • 4
17
votes
2 answers

AttributeError: 'str' object has no attribute 'view' in Seaborn , Scatterplot

I am getting a bizarre exception in Seaborn. For a reproducible…
user8270077
  • 4,621
  • 17
  • 75
  • 140
17
votes
1 answer

How to customize marker colors and shapes in scatter plot?

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…
Elham
  • 827
  • 2
  • 13
  • 25