scatter

Python plotly.express – add labels in scatter_geo

Python plotly.express – add labels in scatter_geo Question: I need to add static labels on markers in scatter_geo vizualization. I added text=’data’, but nothing had happend: import plotly.express as px import pandas as pd rows=[[‘501-600′,’15’,’122.58333′,’45.36667′], [’till 500′,’4′,’12.5′,’27.5′], [‘more 1001′,’41’,’-115.53333′,’38.08′], ] colmns=[‘bins’,’data’,’longitude’,’latitude’] df=pd.DataFrame(data=rows, columns=colmns) df = df.astype({“data”: int}) fig=px.scatter_geo(df,lon=’longitude’, lat=’latitude’, color=’bins’, text=’data’, opacity=0.5,size=’data’, projection=”natural earth”) fig.show() …

Total answers: 2

Specify color of each point in scatter plot (matplotlib)

Specify color of each point in scatter plot (matplotlib) Question: I have a 3D Plot that I created using matplotlib, and I have a list of rbg values that correspond to each point. I have the X, Y, and Z data, and then I have a “color list” of the form: [ (r,g,b), (r,g,b), … …

Total answers: 3

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

Creating Pandas Dataframe between two Numpy arrays, then draw scatter plot Question: 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 …

Total answers: 3

How to add trendline in python matplotlib dot (scatter) graphs?

How to add trendline in python matplotlib dot (scatter) graphs? Question: How could I add a trendline to a dot graph drawn using matplotlib.scatter? Asked By: user3476791 || Source Answers: as explained here With help from numpy one can calculate for example a linear fitting. # plot the data itself pylab.plot(x,y,’o’) # calc the trendline …

Total answers: 2

Matplotlib: Scatter Plot to Foreground on top of a Contour Plot

Matplotlib: Scatter Plot to Foreground on top of a Contour Plot Question: Does anyone know a way to bring a scatter plot to the foreground in matplotlib? I have to display the scatter plotting on top of the contour, but by default it is plotted underneath… Thanks in advance! Asked By: Mike || Source Answers: …

Total answers: 1

Combining scatter plot with surface plot

Combining scatter plot with surface plot Question: 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? Asked By: xelda_serve || Source Answers: To combine various types of plots in the same graph you should use the …

Total answers: 3

Python scatter plot. Size and style of the marker

Python scatter plot. Size and style of the marker Question: 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] scatter(x,y,c=z,s=dx,marker=’s’) The problem is that …

Total answers: 3

Partially transparent scatter plot, but with a solid color bar

Partially transparent scatter plot, but with a solid color bar Question: 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, …

Total answers: 2

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

How to do a scatter plot with empty circles in Python? Question: 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 …

Total answers: 6