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

Python - plot rectangles of known size at scatter points

I have a set of points: a = ([126, 237, 116, 15, 136, 348, 227, 247, 106, 5, -96, 25, 146], [117, 127, 228, 107, 6, 137, 238, 16, 339, 218, 97, -4, -105]) And I make a scatter plot of them like so: fig = plt.figure(figsize = (15,6)) ax =…
SuperCiocia
  • 1,823
  • 6
  • 23
  • 40
10
votes
1 answer

Adding italicised r with correlation coefficient to a scatter plot chart in ggplot

I'm trying to use the code below to generate a simple scatter plot with a correlation coefficient that would have italicised r placed on the plot. data(mtcars) # Load required libraries require(ggplot2) # To derive the…
Konrad
  • 17,740
  • 16
  • 106
  • 167
10
votes
1 answer

How can I draw a scatter plot with contour density lines in polar coordinates using Matplotlib?

I am trying to make a scatter plot in polar coordinates with the contour lines superposed to the cloud of points. I am aware of how to do that in cartesian coordinates using numpy.histogram2d: # Simple case: scatter plot with density contours in…
10
votes
2 answers

Multiple data in scatter matrix

Is it possible to add multiple data to a pandas.tools.plotting.scatter_matrix and assigning a color to each group of data? I'd like to show the scatter plots with data points for one group of data, let's say, in green and the other group in red in…
Manuel
  • 801
  • 3
  • 8
  • 20
10
votes
2 answers

draw a smooth polygon around data points in a scatter plot, in matplotlib

I have a bunch of cross plots with two sets of data and have been looking for a matploltib way of highlighting their plotted regions with smoothed polygon outlines. At the moment i just use Adobe Illustrator and amend saved plot, but this is not…
user1665220
  • 678
  • 2
  • 7
  • 17
10
votes
1 answer

Choosing marker size in Matplotlib

I am doing a scatter plot with square marker in matplotlib like this one: . I want to achieve something like this: Which means I have to adjust the marker size and the figure size/ratio in such a way that there are no white space between markers.…
elyase
  • 39,479
  • 12
  • 112
  • 119
10
votes
2 answers

Matplotlib remove interpolation for missing data

I am plotting timeseries data using Matplotlib and some of the data is missing in the sequence. Matplotlib implicitly joins the last contiguous data point to the next one. But in case data is missing, the plot looks ugly. The following is the plot…
Nipun Batra
  • 11,007
  • 11
  • 52
  • 77
9
votes
2 answers

How to create a time scatterplot with R?

The data are a series of dates and times. date time 2010-01-01 09:04:43 2010-01-01 10:53:59 2010-01-01 10:57:18 2010-01-01 10:59:30 2010-01-01 11:00:44 … My goal was to represent a scatterplot with the date on the horizontal axis (x) and the time…
karlcow
  • 6,977
  • 4
  • 38
  • 72
9
votes
1 answer

Trying to add a colorbar to a Seaborn scatterplot

I'm a geology master's student working on my dissertation with a focus on the Sulfur Dioxide output of a number of volcanoes in the South Pacific. I have a little experience with R but my supervisor recommended python (JupyterLab specifically) for…
Wild.Geodude
  • 173
  • 2
  • 2
  • 6
9
votes
3 answers

How to plot a scatter plot with a legend label for each class

I am interested in plotting a legend in my scatterplot. My current code looks like this x=[1,2,3,4] y=[5,6,7,8] classes = [2,4,4,2] plt.scatter(x, y, c=classes, label=classes) plt.legend() The problem is that when the plot is created, the legend is…
user3276768
  • 1,416
  • 3
  • 18
  • 28
9
votes
2 answers

Plot each column against each column

I have a dataframe ("data") with 7 columns (2 Factor, 5 num). The first column is containing the names of 7 different countries and in the following columns I have collected data for different parameters (like population, GDP etc.) characterizing…
Jonathan Rhein
  • 1,616
  • 3
  • 23
  • 47
9
votes
1 answer

Matplotlib scatter marker size

I'm trying to plot a 3D scatter with matplotlib The problem is that I can't change the marker's size I have this scat = plt.scatter([boid_.pos[0] for boid_ in flock], [boid_.pos[1] for boid_ in flock], …
PerroNoob
  • 843
  • 2
  • 16
  • 36
9
votes
1 answer

How to modify 2d Scatterplot to display color based off third array in csv file?

I am using Python and a CSV file. I am currently trying to modify the scatter plot(2d) below to change colors based on a third column in my csv file. After searching through multiple posts, I basically want to use a generic colormap (rainbow) and…
Jonny
  • 619
  • 4
  • 12
  • 31
8
votes
1 answer

R two regressions from one table

I am trying to plot two different regression lines (with the formula: salary = beta0 + beta1D3 + beta2spending + beta3*(spending*D3) + w) into one scatter plot by deviding the data I have into two subsets as seen in the following code: salary =…
Mark
  • 83
  • 4
8
votes
4 answers

Seaborn scatterplot set hollow markers instead of filled markers

Using a Seaborn scatterplot, how can I set the markers to be hollow circles instead of filled circles? Here is a simple example: import pandas as pd import seaborn as sns df = pd.DataFrame( {'x': [3,2,5,1,1,0], 'y': [1,1,2,3,0,2], …
a11
  • 3,122
  • 4
  • 27
  • 66