-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bff0ac4
commit 5aed1f6
Showing
9 changed files
with
526 additions
and
26 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
### 0.7.0 | ||
|
||
- SVG generation support | ||
- Keyword arguments supported in addition to dictionary | ||
|
||
### 0.6.0 | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from .hooman import Hooman | ||
from .formula import * | ||
|
||
version_info = (0, 6, 0) | ||
version_info = (0, 7, 0) | ||
__version__ = ".".join([str(v) for v in version_info]) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,47 @@ | ||
import seaborn as sns | ||
import matplotlib.pyplot as plt | ||
sns.set_theme(style="whitegrid") | ||
|
||
# Load the example diamonds dataset | ||
diamonds = sns.load_dataset("diamonds") | ||
|
||
# Draw a scatter plot while assigning point colors and sizes to different | ||
# variables in the dataset | ||
f, ax = plt.subplots(figsize=(6.5, 6.5)) | ||
sns.despine(f, left=True, bottom=True) | ||
clarity_ranking = ["I1", "SI2", "SI1", "VS2", "VS1", "VVS2", "VVS1", "IF"] | ||
sns.scatterplot(x="carat", y="price", | ||
hue="clarity", size="depth", | ||
palette="ch:r=-.2,d=.3_r", | ||
hue_order=clarity_ranking, | ||
sizes=(1, 8), linewidth=0, | ||
data=diamonds, ax=ax) | ||
# https://github.com/mwaskom/seaborn-data/blob/master/penguins.csv | ||
|
||
from hooman import Hooman | ||
import pandas as pd | ||
import os | ||
|
||
window_width, window_height = 650, 600 | ||
hapi = Hooman(window_width, window_height, svg=True) | ||
|
||
|
||
base_path = os.path.dirname(os.path.abspath(__file__)) | ||
df = pd.read_csv(os.path.join(base_path, "data", "penguins.csv")) | ||
df = df.fillna(0) | ||
|
||
data = {k:list(df[k]) for k in df.columns.values.tolist()} | ||
|
||
hapi.background(255) | ||
|
||
colx = "bill_length_mm" | ||
coly = "bill_depth_mm" | ||
|
||
hapi.scatterchart( | ||
40, | ||
30, | ||
500, | ||
500, | ||
{ | ||
"data": data, | ||
"ticks_y": 12, | ||
"ticks_x": 12, | ||
"range_y": [min(data[coly]), max(data[coly])], | ||
"range_x": [min(data[colx]), max(data[colx])], | ||
"show_axes": True, | ||
"tick_size": 10, | ||
"show_ticks_x": True, | ||
"show_ticks_y": True, | ||
"x": colx, | ||
"y": coly, | ||
"plot_background": False, | ||
"plot_grid": False, | ||
"line_color": 200, | ||
"type": "hist", | ||
"hist_color": "g" | ||
}, | ||
) | ||
|
||
hapi.save_svg(os.path.join(base_path, 'file.svg')) |
Oops, something went wrong.