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

Matplotlib--scatter plot with half filled markers

Question: Using a scatter plot in matplotlib, is there a simple way get a half-filled marker? I know half-filled markers can easily be done using a line plot, but I would like to use 'scatter' because I want to use marker size and color (i.e.,…
5
votes
2 answers

Axis position in R scatterplot

I'm trying to create a simple scatter plot in R, where the x-axis range is -10:10, and to re-locate the y axis to the x=0 point. This seems like a fairly basic operation, but I found no way to do that... Thanks for any help!
HEnav
  • 133
  • 1
  • 3
  • 7
5
votes
2 answers

AttributeError: module 'matplotlib' has no attribute 'scatter'

I'm trying to make cluster of latitude and longitude. the code gave an error in plt.scatter(data['Lng'],data['Lat']) line the error is: AttributeError: module 'matplotlib' has no attribute 'scatter' code: import numpy as np import pandas as…
Osama Billah
  • 73
  • 1
  • 1
  • 8
5
votes
2 answers

Add colorbar as legend to matplotlib scatterplot (multiple subplots, multiple scatters)

I have several subplots to which I want to add a single colorbar. Each subplot consists of 7 scatters. I found advise on how to add colorbars, but they are mostly related to the value of each scatter-point and not to the row itself. Representative…
offeltoffel
  • 2,691
  • 2
  • 21
  • 35
5
votes
1 answer

Plot hollow circles in plt.scatter

I would like to plot a scatter plot by using 2 indexes [ChildrenHeight, ParentHeight] for a categorical variable: [gender]. However, I have tired many approaches to draw a empty circle with distinct edgecolors. I have tried: plt.scatter(X[:, 0],…
Qing
  • 51
  • 1
  • 1
  • 5
5
votes
1 answer

How can the sizes and rotations of text of a pandas scatter matrix be set?

I'm creating a big scatter matrix and want to change the text such that it is neat, aligned, doesn't overlap etc. To do this I want to explore reducing the font size and changing the text rotation (and anything else reasonable). How could I do…
BlandCorporation
  • 1,324
  • 1
  • 15
  • 33
5
votes
1 answer

How to increase marker size of the legend in scatter plot in MATLAB 2014b?

I found marker size in the scatter plot and the legend is different in MATLAB 2014b. I searched & found some solution from earlier version of MATLAB, which are not applicable in the latest version. In my current version, the marker size in legend is…
user962808
  • 115
  • 1
  • 2
  • 10
5
votes
1 answer

scatter plot data does not appear on continents in 'hammer' basemap

I am attempting to plot a dataset over the 'hammer' basemap using a scatter plot. However, the data points won't plot on top of the continents. I noticed in the matplotlib example, there is also not data on the continents (I assumed this was due to…
WillaB
  • 420
  • 5
  • 12
5
votes
2 answers

`map.scatter` on basemap not displaying markers

I have a map of Germany, and the coords of a few cities. plot displays the dots properly. I would like to use scatter instead, in order to be able to color the markets with respect to an other variable and then display a colorbar. The code runs in…
NoIdeaHowToFixThis
  • 4,484
  • 2
  • 34
  • 69
5
votes
1 answer

Is there a way to make matplotlib scatter plot marker or color according to a discrete variable in a different column?

I'm making scatterplots out of a DF using matplotlib. In order to get different colors for each data set, I'm making two separate calls to plt.scatter: plt.scatter(zzz['HFmV'], zzz['LFmV'], label = dut_groups[0], color = 'r'…
Charlie_M
  • 1,281
  • 2
  • 16
  • 20
5
votes
2 answers

Why won't my Python scatter plot work?

I created a very simple scatter plot using pylab. pylab.scatter(engineSize, fuelMile) pylab.show() The rest of the program isn't worth posting, because it's that line that's giving me the problem. When I change "scatter" to "plot" it graphs the…
user212562
  • 195
  • 1
  • 2
  • 6
5
votes
2 answers

Correct scaling of circular markers in scatter plot

I have a system of finite size circular particles (say r=5cm) which I need to plot in a given domain (say L=5m). Since they are many, scatter is faster than any cyclic use of rectangle. What is unclear to me is the correct way to define the…
Acorbe
  • 8,367
  • 5
  • 37
  • 66
5
votes
2 answers

NVD3 javascript: add colors to points in a scatter plot

I am trying to make a scatter plot from some data with x, y, and z values. My code is the same as the example on the NVD3 website, http://nvd3.org/ghpages/scatter.html, except I also calculate a z value. Lets say z = x + y. Instead of changing the…
Scott
  • 65
  • 2
  • 6
5
votes
2 answers

How do I create a scatter plot with graduated marker colours in MATLAB?

I would like to plot a simple scatter graph in MATLAB, with marker colours varying from one end of the spectrum to the other (e.g. red, orange, yellow....blue, purple). My data compares the amount of water in a river with the quality of the water,…
user1913275
  • 73
  • 1
  • 1
  • 6
4
votes
2 answers

Plotly python add annotation to display all column values at every point

I am trying to plot all column values at each point when we hover over a data point in plotly My code is as follows import plotly.graph_objects as go import plotly.io as pio from plotly.subplots import make_subplots import pandas as pd #…
anonymous13
  • 581
  • 1
  • 5
  • 17