How to change spot edge colors in seaborn scatter plots
Replace edgecolors=None with linewidth=0 Something like: g=sns.scatterplot(x=”length”, y=”coverage”, data=df, hue=”Products”, linewidth=0, alpha = 0.7)
Replace edgecolors=None with linewidth=0 Something like: g=sns.scatterplot(x=”length”, y=”coverage”, data=df, hue=”Products”, linewidth=0, alpha = 0.7)
You have found that example on the newest version of the seaborn module, which is 0.9. From the “What’s new in each version” section: New relational plots Three completely new plotting functions have been added: relplot(), scatterplot(), and lineplot() So, you need to update your seaborn to the latest version to use these plotting functions.
It seems that linestyle= argument doesn’t work with lineplot(), and the argument dashes= is a bit more complicated than it might seem. A (relatively) simple way of doing it might be to get a list of the Line2D objects on the plot using ax.lines and then set the linestyle manually: import seaborn as sns import … Read more
When you set aspect argument of FacetGrid not only axis limits but the sizes and positions of axis labels and titles are also took into consideration to calculate proper axis geometry. Therefore heatmaps are rectangles. To adjust quadratic heatmap and axis you may set corrected axis bounding box position manually with function set_bbox. Another way … Read more
As mentioned in the comments, you can use the to_html() method to obtain an HTML of the styled table (in old versions it was render()): html = styled_table.to_html() You can then use a package that converts html to an image. For example, IMGKit: Python library of HTML to IMG wrapper. Bear in mind that this … Read more
It looks like the following line solves the issue: plt.ticklabel_format(style=”plain”, axis=”y”) Here is the documentation link.
Before calling sns.heatmap, get the axes using plt.subplots, then use set_xlabel and set_ylabel. For example: import seaborn as sns import matplotlib.pyplot as plt # Load the example flights dataset and conver to long-form flights_long = sns.load_dataset(“flights”) flights = flights_long.pivot(“month”, “year”, “passengers”) # ADDED: Extract axes. fig, ax = plt.subplots(1, 1, figsize = (15, 15), dpi=300) … Read more
You can use plt.yscale(‘symlog’) to set the scale to a symmetic log scale. This means that it will scale logarithmically to both sides of 0. Only using the negative part of the symlog scale would work just fine.
mybins=np.logspace(0, np.log(100), 100) g = sns.JointGrid(data1, data2, data, xlim=[.5, 1000000], ylim=[.1, 10000000]) g.plot_marginals(sns.distplot, color=”blue”, bins=mybins) g = g.plot(sns.regplot, sns.distplot) g = g.annotate(stats.pearsonr) ax = g.ax_joint ax.set_xscale(‘log’) ax.set_yscale(‘log’) g.ax_marg_x.set_xscale(‘log’) g.ax_marg_y.set_yscale(‘log’) This worked just fine. In the end, I decided to just convert my table values into log(x), since that made the graph easier to scale and … Read more
I would rather prefer to use it this way. You need to remove hue as I assume it has a different purpose which doesn’t apply in your current DataFrame because you have a single line. Visit the official docs here for more info. df=pd.DataFrame({‘test’:range(9),’test2′:range(9)}) sns.lineplot(x=df.index, y=’test’, data=df) Output