scatter-plot

how to add a colorbar to a plot

how to add a colorbar to a plot Question: i have a dataframe with two columns The one is dif and the other is sza i have made the following scatter plot x = df[‘sza’] y = df[‘dif’] # Calculate the point density xy = np.vstack([x,y]) z = gaussian_kde(xy)(xy) fig, ax = plt.subplots() ax.scatter(x, y, …

Total answers: 1

How to draw diagonal lines in a loglog plot in matplotlib?

How to draw diagonal lines in a loglog plot in matplotlib? Question: I have a scatterplot where both axes are in logarithmic scale. For instance, a plot generated with the following code: import matplotlib.pyplot as plt import numpy as np rng = np.random.RandomState(42) x = np.logspace(0, 3, 100) y = np.logspace(0, 3, 100) + rng.randn(100) …

Total answers: 1

How to change colors of a variable in a kdeplot or scatterplot

How to change colors of a variable in a kdeplot or scatterplot Question: From this dataframe that represent the position of a fish according to different months: X Y Month 2040 2760 1 2041 2580 1 2045 2762 1 2047 2763 2 2053 2774 3 and through this seaborn script: fig,ax=plt.subplots() kde = sns.kdeplot(data=HR25, x=’X’, …

Total answers: 1

Highlight a single point in a boxplot in Plotly

Highlight a single point in a boxplot in Plotly Question: I have a boxplot in Plotly. I would like to overlay a single point on some of the boxes. I thought I could do this by adding a scatter trace to the fig, but when I look into the data of the figure I can’t …

Total answers: 1

Matplotlib scatter plot automatically duplicate datetime xticks

Matplotlib scatter plot automatically duplicate datetime xticks Question: In my dataframe I have, for each day, the mean value of cardiac frequency during the day and during the night that I previously calculated. The problem is that when I try to do a scatter plot, the values on the x axis get duplicated. So this …

Total answers: 1

Place ellipsis on seaborn catplot

Place ellipsis on seaborn catplot Question: I have a seaborn.catplot that looks like this: What I am trying to do is highlight differences in the graph with the following rules: If A-B > 4, color it green If A-B < -1, color it red If A-B = <2= and >=0, color it blue I am …

Total answers: 1

Plotly make marker overlay add_trace

Plotly make marker overlay add_trace Question: I have the following Scatterternary plot below. Whenever I add_trace, the marker remains under it (so you cannot even hover it). How can I make the marker circle above the red area? [In implementation, I will have several areas and the marker may move around] I tried adding fig.update_ternaries(aaxis_layer="above …

Total answers: 1

Seaborn axvspan alterating x-axis

Seaborn axvspan alterating x-axis Question: I’m trying to create some scatter plots, with seaborn with a specific area of each plot highlighted in red. However when I add the code for axvspan, it changes the x-axis. This is how the plots look prior to axvspan being applied. When i apply the line for axvpsan: fig, …

Total answers: 1