relplot

How can I plot st error bars with seaborn relplot?

How can I plot st error bars with seaborn relplot? Question: I am studying different variables. I want to plot the results with the stadnard error. I use the filter function because depending on what I want to analyse, I am interested in just plotting mineral, or just plotting one material…etc. I mention this because …

Total answers: 1

How can I plot a line with markers for separate categories in a relplot?

How can I plot a line with markers for separate categories in a relplot? Question: Using Seaborn I would like to plot both SBP and DBP columns as below. To achieve this, I use: plt.style.use(‘ggplot’) g = sns.relplot(data=r_29, x="DATE_TIME", y="SBP", col="VISIT", col_wrap=2, facet_kws={‘sharey’: False, ‘sharex’: False}, aspect=2, marker=’o’) g = sns.relplot(data=r_29, x="DATE_TIME", y="DBP", col="VISIT", col_wrap=2, …

Total answers: 1

How to set axis label format to scientific format in seaborn relplot with facets when axes are not shared

How to set axis label format to scientific format in seaborn relplot with facets when axes are not shared Question: I am creating a facet plot with the seaborn library with: titanic = sns.load_dataset(‘titanic’) g = sns.relplot(data=titanic, x=’fare’, y=’age’, col=’sex’, row=’survived’, height=2, facet_kws=dict(sharex=False, sharey=False)) g.set_titles(row_template='{row_name}’, col_template='{col_name}’) plt.ticklabel_format(axis=’both’, style=’scientific’, scilimits=(0, 0)) I would like ALL subplots …

Total answers: 1

Introducing a second y axis into a relplot() call with multiple plots

Introducing a second y axis into a relplot() call with multiple plots Question: The Problem I have 2 dataframes which I combine and then melt with pandas. I need to multi-plot them (as below) and the code needs to be scalable. They consist of 2 variables which form the ‘key’ column below (‘x’ and ‘y’ …

Total answers: 2

FacetGrid returned seaborn's relplot does not respect hue

FacetGrid returned seaborn's relplot does not respect hue Question: I am encountering a problem in which seaborn’s relplot function creates a FacetGrid that is different from creating the FacetGrid manually. I find this unintuitive and would like the relplot function to give me a FacetGrid that behaves similarly to the manually created one. The issue …

Total answers: 1

How to specify the palette in a seaborn figure-level plot

How to specify the palette in a seaborn figure-level plot Question: I’ve learned to not use seaborn if I need to make specific changes or detail oriented visualizations but I feel like I’m not fully utilizing what it has to offer at times. I have a series of 2D slices plotting cluster memberships. Issue is …

Total answers: 1

How to invert the axis of a seaborn figure-level plot (FacetGrid)

How to invert the axis of a seaborn figure-level plot (FacetGrid) Question: I would like to invert the y-axis in each plot of a Facetgrid. Below you find a reduced example of the code: import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt df_test = pd.DataFrame({‘a’:[‘yes’, ‘no’]*5, ‘b’:np.arange(10), …

Total answers: 1

seaborn.lmplot raises ValueError when set both `hue` and `scatter_kws`'s `s`

seaborn.lmplot raises ValueError when set both `hue` and `scatter_kws`'s `s` Question: This code is provided in the book "Pandas for everyone" (3.4.3.2 Size and Shape). import seaborn as sns from matplotlib import pyplot as plt tips = sns.load_dataset(‘tips’) sns.lmplot( x=’total_bill’, y=’tip’, data=tips, fit_reg=False, hue=’sex’, scatter_kws={‘s’: tips[‘size’] * 10} ) plt.show() When I run this code, …

Total answers: 1

How to show scientific notation in a relplot

How to show scientific notation in a relplot Question: I have a seaborn relplot. I want to show scientific notation. Presently the image takes large space on x and y ticks. I want to minimize it by converting the axis to scientific notation. My code: sns.relplot(x=’Vmpp’,y=’cVmpp’,data=cdf) My solution and present output: #I tried a solution …

Total answers: 2

How to plot wide format dataframe with seaborn.relplot

How to plot wide format dataframe with seaborn.relplot Question: I am trying to plot the following line graph with dummy data on 5 cities(C1-C5). Based on what I understand, x="Year", y="Number of Employees" and hue="City". How would I set up the code for it? I have tried doing it in the following manner, but it …

Total answers: 1