Questions tagged [scatter]

A scatter plot is a type of mathematical diagram using Cartesian coordinates to display values for two variables for a set of data.

A scatter plot is a type of mathematical diagram using Cartesian coordinates to display values for two variables for a set of data.

943 questions
253
votes
6 answers

How to do a scatter plot with empty circles in Python?

In Python, with Matplotlib, how can a scatter plot with empty circles be plotted? The goal is to draw empty circles around some of the colored disks already plotted by scatter(), so as to highlight them, ideally without having to redraw the colored…
Eric O. Lebigot
  • 91,433
  • 48
  • 218
  • 260
60
votes
3 answers

Creating Pandas Dataframe between two Numpy arrays, then draw scatter plot

I'm relatively new with numpy and pandas (I'm an experimental physicist so I've been using ROOT for years...). A common plot in ROOT is a 2D scatter plot where, given a list of x- and y- values, makes a "heatmap" type scatter plot of one variable…
n3utrino
  • 1,160
  • 1
  • 8
  • 16
47
votes
3 answers

Partially transparent scatter plot, but with a solid color bar

In Python, with Matplotlib, how to simply do a scatter plot with transparency (alpha < 1), but with a color bar that represents their color value, but has alpha = 1? Here is what one gets, with from pylab import *; scatter(range(10), arange(0, 100,…
Eric O. Lebigot
  • 91,433
  • 48
  • 218
  • 260
40
votes
3 answers

Python scatter plot. Size and style of the marker

I have a set of data that I want to show as a scatter plot. I want each point to be plotted as a square of size dx. x = [0.5,0.1,0.3] y = [0.2,0.7,0.8] z = [10.,15.,12.] dx = [0.05,0.2,0.1] …
Brian
  • 13,996
  • 19
  • 70
  • 94
37
votes
2 answers

"Error: Continuous value supplied to discrete scale" in default data set example mtcars and ggplot2

I am trying to replicate the example here (sthda.com) using the following code: # Change point shapes and colors manually ggplot(mtcars, aes(x=wt, y=mpg, color=cyl, shape=cyl)) + geom_point() + geom_smooth(method=lm, se=FALSE, fullrange=TRUE)+ …
Katherine Hepworth
  • 375
  • 1
  • 3
  • 4
31
votes
1 answer

matplotlib scatter plot colour as function of third variable

I would like to know how to make matplotlib's scatter function colour points by a third variable. Questions gnuplot linecolor variable in matplotlib? and Matplotlib scatterplot; colour as a function of a third variable posed similar queries,…
aaron_python_dude
  • 321
  • 1
  • 3
  • 6
21
votes
3 answers

Changing marker style in scatter plot according to third variable

I am dealing with a multi-column dictionary. I want to plot two columns and subsequently change color and style of the markers according to a third and fourth column. I struggle with changing the marker style in the pylab scatter plot. My approach,…
Krn
  • 313
  • 1
  • 2
  • 6
20
votes
2 answers

How to make scatter plots with semitransparent points in Gnuplot?

How can I plot an image with partially transparent scatter points, just like in the picture below, with Gnuplot? The problem is that I don’t know how to set the points to be transparent.
Dd H
  • 331
  • 1
  • 3
  • 9
19
votes
2 answers

R- plot numbers instead of points

I have successfully made a scatterplot, with different symbols for each data series. But what I want to do is make the same scatterplot with the point to show up as numbers. Not the value of each point, just an assigned number. As of right now,…
Valerie S
  • 917
  • 2
  • 7
  • 17
18
votes
5 answers

How to add traces in plotly.express

I am very new to python and plotly.express, and I find it very confusing... I am trying to use the principle of adding different traces to my figure, using example code shown here https://plotly.com/python/line-charts/, Line Plot Modes, #Create…
MikkelC
  • 261
  • 1
  • 3
  • 9
17
votes
4 answers

matlab: scatter plots with high number of datapoints

I'm trying to plot scatter, something like: scatter(coor(:, 2), coor(:, 3), 1, coor(:, 4)); The problem is, that I have quite big number of coordinates to plot (~100 000). Its taking long time to plot it, and when I try to export figure to tiff -…
Art
  • 1,196
  • 5
  • 18
  • 34
16
votes
1 answer

Scale matplotlib.pyplot.Axes.scatter markersize by x-scale

I would like to scale the markersize of matplotlib.pyplot.Axes.scatter plot based on the number of points on the x/y-axis. import matplotlib.pyplot as plt import numpy as np vmin = 1 vmax = 11 x = np.random.randint(vmin, vmax, 5) y =…
fsimkovic
  • 1,078
  • 2
  • 9
  • 21
16
votes
2 answers

python 3 scatter plot gives "ValueError: Masked arrays must be 1-D" even though i am not using any masked array

I am trying to plot a scatter plot using the .scatter method below. Here ax.scatter(X[:,0], X[:,1], c = colors, marker = 'o', s=80, edgecolors = 'none') with the input/args classes below: X[:,0]] type:
houdinisparks
  • 1,180
  • 1
  • 10
  • 16
15
votes
4 answers

Running median of y-values over a range of x

Below is a scatter plot I constructed from two numpy arrays. Scatter Plot Example What I'd like to add to this plot is a running median of y over a range of x. I've photoshoped in an example: Modified Scatter Plot Specifically, I need the median…
mjcowley
  • 175
  • 1
  • 7
15
votes
3 answers

Combining scatter plot with surface plot

How can I combine a 3D scatter plot with a 3D surface plot while keeping the surface plot transparent so that I can still see all the points?
xelda_serve
  • 161
  • 1
  • 1
  • 5
1
2 3
62 63