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

Pandas not in index error trying a scatter plot

I was trying to do a scatter plot. I was trying with the next code df = pd.DataFrame({'$a':[1,2], '$b': [10,20]}) df.columns = ['a', 'b'] df df.plot.scatter(df['a'], df['b']) I get the error KeyError: '[1 2] not in index' Any idea why this…
frank99
  • 21
  • 1
  • 3
2
votes
2 answers

Color code points of 3D scatter plot according to density of points

I have a 3D scatter plot of points in the xyz-sphere. I was wondering if there is a way to colormap/hue the scatter plot based on the density of the data. Basically, the parts of the scatter plot with the most densely clustered data points would be…
Anonymous
  • 239
  • 4
  • 16
2
votes
1 answer

Change size of markers in scatter3

I want to draw a set of points each with different colors. Unfortunately the dots become really small. How can I change that? This is how my code looks right now, but it is not working % Draw with different colors colors = ['b'; 'k'; 'r'; 'g'; 'm';…
Natjo
  • 2,005
  • 29
  • 75
2
votes
1 answer

Oxyplot showing HeatMapSeries behind ScatterSeries

I am trying to combine LineSeries, ScatterSeries and HeatmapSeries on a single OxyPlot instance. I am able to show the first two just fine on the same plot and it looks like the following: The axes for this are generated by the following code: var…
2
votes
3 answers

Jitter dots without overlap

My data: a <- sample(1:5, 100, replace = TRUE) b <- sample(1:5, 100, replace = TRUE) c <- sample(1:10, 100, replace = TRUE) d <- sample(1:40, 100, replace = TRUE) df <- data.frame(a, b, c, d) Using ggplot2, I have created scatterplot over x = a and…
tjebo
  • 21,977
  • 7
  • 58
  • 94
2
votes
1 answer

MATLAB quiver3 colormap

I have a quiver3 plot on MATLAB with the code and plot as following, and I would like the lines to be color-variant as they approach the center point (which is cyan blue), so that I could visulize their distances from the center. Any idea how could…
jiayi
  • 89
  • 10
2
votes
2 answers

Matplotlib: add twin y axis without using its values in the plots

This is to clarify the question title. Say you have four lists of integers, with which you want to produce a scatter plot: a=[3,7,2,8,12,17] b=[9,4,11,7,6,3] c=[9,3,17,13,10,5] d=[5,1,1,14,5,8] You also have a function, for simplicity f(x)=1/x,…
FaCoffee
  • 7,609
  • 28
  • 99
  • 174
2
votes
1 answer

Pandas/Python/Matplotlib scatter plot markers colour depending on a value from a cell

I have been searching for solution on how to set points on a scatter plot depending on the value of a 'third' column. I could not find any ready-made solution, thus I have constructed my own, and I want to share it (maybe someone will make a use of…
Sylwek
  • 97
  • 1
  • 8
2
votes
2 answers

Swarmplot with more than just one categorical level (Python)

I am trying to make a swam plot that contains more information than a single categorical level and two variables. I am looking to create something like this So ideally, something like this would work (but it does not): ax =…
amaatouq
  • 2,297
  • 5
  • 29
  • 50
2
votes
1 answer

How to create and empty scatter plot with date on the x axis - Python, Pandas?

I have a dataframe that looks like this: date number_of_books ... (additional columns) 1997/06/01 23:15 3 1999/02/19 14:56 5 1999/10/22 18:20 7 2001/11/04 19:13 19 ... …
Sam
  • 319
  • 1
  • 4
  • 11
2
votes
1 answer

Highlight/find data points in plotly scatter from the browser

I generated a scatterplot in HTML format using plotly and a generic dataframe. I am aware that it is possible to highlight (with a different color for example) certain data points before generating the plot HTML. However, I wonder if it is possible…
ODiogoSilva
  • 2,394
  • 1
  • 19
  • 20
2
votes
1 answer

How to add legend to scatter plot that has colour assignment

I have an a list of x and y values and list of colour assignments for each point ('green', 'blue', 'red', etc). All of the examples I have found produce a legend based on separate plt.scatter() commands which later a simple plt.legend() suffices.…
Spencer Trinh
  • 743
  • 12
  • 31
2
votes
1 answer

resize widget in kivy scatter

I want to use kivy scatter in order to resize the widgets which scatter contains. So, I created box_total contained in scatter, contained in floatlayout. This is the code: from kivy.app import App from kivy.uix.scatter import Scatter from…
user3060854
  • 923
  • 2
  • 15
  • 25
2
votes
1 answer

python - scatter plot with dates and 3rd variable as color

I am trying to plot an x-y plot, with x or y as date variable, and using a 3rd variable to color the points. I managed to do it if none of the 3 variables are date, using: ax.scatter(df['x'],df['y'],s=20,c=df['z'], marker = 'o', cmap = cm.jet…
Kil.Th
  • 75
  • 6
2
votes
2 answers

In ggplot for Python, using discrete X scale with geom_point()?

The following example returns an error. It appears that using a discrete (not continuous) scale for the x-axis in ggplot in Python is not supported? import pandas as pd import ggplot df = pd.DataFrame.from_dict({'a':['a','b','c'], …
canary_in_the_data_mine
  • 2,193
  • 2
  • 24
  • 28