Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to plot multiple scatter plots in seaborn
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")
I want to plot separate graphs for each category of "method'

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 .
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

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Plot multiple csv into one graph problem with visualize linkxxx86 1 116 Oct-14-2019, 05:54 PM
Last Post: linkxxx86
  y-axis on seaborn heatmap not aligned properly amjass12 0 90 Oct-01-2019, 10:37 AM
Last Post: amjass12
  How to manually define color bar scale in seaborn heatmap SriRajesh 3 1,368 Sep-08-2019, 11:12 AM
Last Post: RudraMohan
  How to plot vertically stacked plot with same x-axis and SriMekala 0 173 Jun-12-2019, 03:31 PM
Last Post: SriMekala
  Saving multiple plots as pdf mohd_umair 0 268 Apr-28-2019, 01:21 PM
Last Post: mohd_umair
  Create Animated Scatter plot in 3d using matplotlib in python barry76 0 767 Mar-29-2019, 12:13 PM
Last Post: barry76
  scatter plot error - possibly data type - TypeError: nan is not a string chudson 1 926 Mar-24-2019, 11:48 AM
Last Post: chudson
  Can't locate plots package BobLoblaw 12 3,007 Oct-04-2017, 11:56 PM
Last Post: BobLoblaw
  Adding text to plots shaynehansen 0 1,243 Jul-10-2017, 05:54 PM
Last Post: shaynehansen
  Multiple plots with matplotlib - looping j.crater 7 23,159 Sep-23-2016, 06:27 AM
Last Post: j.crater

Forum Jump:

Users browsing this thread: 1 Guest(s)