Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to plot multiple scatter plots in seaborn
#1
Hi Python users,

I'm a beginner and wondering if anyone can help with advice on how to plot multiple scatterplots using a loop

import pandas as pd
import matplotlib as plt
import seaborn as sns, numpy as np
import matplotlib.pyplot as plt
data = pd.read_stata('theta_se_matrix.dta')
sns.pairplot(data, kind="scatter", diag_kind="kde", vars=["theta1", "theta2", "theta3", "theta4", "theta5", "theta6"], hue="method")
plt.show()
I want to plot separate graphs for each category of "method'

Thanks
Quote
#2
Unfortunately, I don't understand the question. line 6 in your code plots a 6x6 grid of axes with probability density estimations on the main diagonal of the grid. hue parameter just makes all graphs colored. If you need to customize pairplot function, you can use PairGrid class .
Quote
#3
The scatter graph is colored based on the hue parameter, but I want separate graphs for each category of the hue parameter.

in my Stata code, what I wanted to graph in Python is implemented as;

forv i=2/7 {
foreach s in theta se {
graph matrix 's'1 's'2 's'3 's'4 's'5 's'6 if method=='i'
}
}

Any help on how to implement in Python will be appreciated
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to plot vertically stacked plot with same x-axis and SriMekala 0 85 Jun-12-2019, 03:31 PM
Last Post: SriMekala
  Plot a small neighborhood map with some GPS trails dervast 2 318 Jun-06-2019, 07:26 AM
Last Post: buran
  Create simple live plot of stock data dram 1 437 May-28-2019, 06:24 AM
Last Post: heiner55
  Plot list arthurvercruysse 2 164 May-20-2019, 12:00 PM
Last Post: arthurvercruysse
  How to plot implicit functions (with two variables) in scipy python using matplotlib? Jay_Nerella 1 149 May-11-2019, 01:17 AM
Last Post: scidam
  Saving multiple plots as pdf mohd_umair 0 128 Apr-28-2019, 01:21 PM
Last Post: mohd_umair
  Wrong dimension for my plot Jemeronimo 1 149 Apr-25-2019, 06:19 PM
Last Post: Larz60+
  Create Animated Scatter plot in 3d using matplotlib in python barry76 0 358 Mar-29-2019, 12:13 PM
Last Post: barry76
  How to plot histogram from 2 arrays? python_newbie09 5 370 Mar-28-2019, 04:20 AM
Last Post: scidam
  scatter plot error - possibly data type - TypeError: nan is not a string chudson 1 449 Mar-24-2019, 11:48 AM
Last Post: chudson

Forum Jump:


Users browsing this thread: 1 Guest(s)