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
12
votes
2 answers

plotting points on top of image in R

These days I am extensively using R to scatter plots. Most of the plotting is concerned with image processing, Recently I was thinking of plotting the scatter plots over an image. For example, I want something like this, The background needs to be…
Alphaneo
  • 12,079
  • 22
  • 71
  • 89
12
votes
1 answer

structure diagram where each members of group are connected to center and all cluster grand center in r

I am trying to create a structure diagram from the data like the following: mydf <- data.frame ( group = rep (1:5, each = 20), z = rnorm (20, 10, 1), x = c(rnorm (20, 2, 0.5), rnorm (20, 2, 0.5), rnorm (20, 9, 0.5), rnorm…
SHRram
  • 4,127
  • 7
  • 35
  • 53
11
votes
2 answers

JFreeChart Scatter Plot Lines

I'm trying to create a graph with JFreeChart, however it doesn't get the lines right. Instead of connecting the points in the order I put them, it connects the points from in order of their x-values. I'm using ChartFactory.createScatterPlot to…
hvitedragonfire
  • 113
  • 1
  • 1
  • 5
11
votes
1 answer

Plot datetime.time in seaborn

Hi I am having trouble plotting a datetime with seaborn. I am trying to plot a categorical data with x as datatype datetime.time but I get these error: float() argument must be a string or a number, not 'datetime.time' This is my df: …
Nikko
  • 1,410
  • 1
  • 22
  • 49
11
votes
1 answer

R plotly hover label text alignment

I'm adding custom hover text for scatterplot points in a plotly graph in R. It appears to be aligning the text left, center, or right depending on whether the text box is shown to the right, center, or the left of the plot points, respectively. I'd…
Brian Stamper
  • 2,143
  • 1
  • 18
  • 41
11
votes
2 answers

Get color of a scatter point

I have a scatter plot with some toy data. I want to draw a label next to a given point with the color of the point. Toy example: x = 100*np.random.rand(5,1) y = 100*np.random.rand(5,1) c = np.random.rand(5,1) fig, ax = plt.subplots() sc =…
user2261062
11
votes
2 answers

One colorbar for multiple scatter plots

I'm plotting multiple figures of the same variable on one plot using matplotlib library. I'm not looking for a colorbar for subplots, which is the dominant search material. I plot multiple scatters, but the colorbar is only set to the values of the…
Dr proctor
  • 177
  • 1
  • 3
  • 7
11
votes
3 answers

Matplotlib: scatter plot with colormaps for edgecolor but no facecolor

I want to have a scatter plot with colormap for edgecolors but no facecolors. When I use facecolor='None', it does not work. import numpy as np import matplotlib.pyplot as plt N = 50 x = np.random.rand(N) y = np.random.rand(N) colors =…
Mohamad Moosavi
  • 131
  • 1
  • 1
  • 6
11
votes
2 answers

Scatter plot change color based on value on list

I'm quite new to matplotlib and i would like to know how we can change color of points on a scatter plot based on the value in a list. In fact, I have a 2-D array that I want to plot and a list with the same number of rows containing, for each…
clechristophe
  • 183
  • 2
  • 2
  • 8
11
votes
2 answers

How to label bubble chart/scatter plot with column from pandas dataframe?

I am trying to label a scatter/bubble chart I create from matplotlib with entries from a column in a pandas data frame. I have seen plenty of examples and questions related (see e.g. here and here). Hence I tried to annotate the plot accordingly.…
Rachel
  • 1,937
  • 7
  • 31
  • 58
11
votes
1 answer

How to set the border color of the dots in matplotlib's scatterplots?

Is it possible to set the color of the borders of the dots that are generated via the Axes.scatter or is it always black? thanks!
fstab
  • 4,801
  • 8
  • 34
  • 66
11
votes
1 answer

Get data from plot with matplotlib

I'm using matplotlib in python to build a scatter plot. suppose I have the following 2 data lists. X=[1,2,3,4,5] Y=[6,7,8,9,10] then I use X as the X-axis value and Y as the Y-axis value to make a scatter plot. So I will have a picture with 5…
Jonathan Pasa Gu
  • 137
  • 1
  • 2
  • 7
10
votes
2 answers

car::scatter3d in R - labeling axis better

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?
CodeGuy
  • 28,427
  • 76
  • 200
  • 317
10
votes
4 answers

How to avoid overlapping text in a plotly scatter plot?

I am looking for a solution to avoid overlapping text in the text-labels. I create the image with plotly scatter. Maybe there is an automation here. from pandas import util import plotly.express as px import plotly.graph_objects as go df =…
Alex
  • 999
  • 1
  • 14
  • 31
10
votes
1 answer

Custom color palette in seaborn

I have a scatterplot that should show the changes in bond lengths depending on temperature. I wanted to give each temperature a specific color, but it doesn't seem to work - plot uses the default seaborn palette. Is there a way to map temperature to…
Anavae
  • 482
  • 1
  • 3
  • 13