Created
February 7, 2018 13:42
-
-
Save anonymous/c26f305ad53197be93a3cb5f2724fb54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
planets = pd.read_csv("planets.csv", sep=',') | |
sns.set(style="ticks") | |
# Initialize the figure with a logarithmic x axis | |
f, ax = plt.subplots(figsize=(7, 6)) | |
ax.set_xscale("log") | |
sns.swarmplot(x="pl_pnum", y="st_mass", data=planets, | |
size=2, color=".3", linewidth=0) | |
# Tweak the visual presentation | |
ax.xaxis.grid(True) | |
ax.set(ylabel="") | |
sns.despine(trim=True, left=True) | |
Error-------------------------------------------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "C:/Users/params4/Downloads/test.py", line 13, in <module> | |
size=2, color=".3", linewidth=0) | |
File "C:\Program Files (x86)\Python 35-32\lib\site-packages\seaborn\categorical.py", line 2786, in swarmplot | |
dodge, orient, color, palette) | |
File "C:\Program Files (x86)\Python 35-32\lib\site-packages\seaborn\categorical.py", line 1203, in __init__ | |
self.establish_variables(x, y, hue, data, orient, order, hue_order) | |
File "C:\Program Files (x86)\Python 35-32\lib\site-packages\seaborn\categorical.py", line 151, in establish_variables | |
raise ValueError(err) | |
ValueError: Could not interpret input 'pl_pnum' | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment