Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove map_id, add sym_x and sym_y #148

Merged
merged 11 commits into from
Jun 15, 2020
Prev Previous commit
Update pie/bar demo
  • Loading branch information
IKupriyanov-HORIS committed Jun 15, 2020
commit 25bac91f608e7185d7dc7d2dea72f65d4ac8aab7
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"metadata": {},
"outputs": [],
"source": [
"from lets_plot import *"
"from lets_plot import *\n",
"import lets_plot.mapping as pm"
]
},
{
Expand Down Expand Up @@ -34,11 +35,12 @@
"metadata": {},
"outputs": [],
"source": [
"data = {'val': [3000, 0, -2000, 1500, 1000, 2500], \\\n",
" 'order': [1, 2, 3, 1, 2, 3], \\\n",
" 'lat': [31, 31, 31, 42, 42, 42],\\\n",
" 'lng': [-100, -100, -100, -93, -93, -93],\\\n",
" 'lnglat': [\"-100,31\",\"-100,31\",\"-100,31\",\"-93,42\",\"-93,42\",\"-93,42\"]}"
"data = {\n",
" 'val': [1500, 1000, 1000, 500, 600, 700, 500, 600, 700, 700],\n",
" 'order': [1, 1, 2, 2, 3, 3, 4, 4 , 5, 5],\n",
" 'lon': [-82, -100, -82, -100, -82, -100, -82, -100, -82, -100],\n",
" 'lat': [28, 31, 28, 31, 28, 31, 28, 31, 28, 31]\n",
"}"
]
},
{
Expand All @@ -49,7 +51,7 @@
},
"outputs": [],
"source": [
"ggplot(data) + geom_livemap(aes(x='lng', y='lat', sym_y='val', fill = 'val'), symbol='bar', size = 30)"
"ggplot(data) + geom_livemap(aes(x='lon', y='lat', sym_y='val', fill='val'), symbol='bar', size = 30)"
]
},
{
Expand All @@ -59,8 +61,8 @@
"outputs": [],
"source": [
"ggplot(data) \\\n",
" + geom_livemap(aes(x='lng', y='lat', sym_y='val', fill='val'), symbol='pie', size=60) \\\n",
" + scale_fill_hue(h = [0.,120.], name = 'order')"
" + geom_livemap(aes(x='lon', y='lat', sym_x='order', sym_y= 'val', fill='val'), symbol='bar', size=50) \\\n",
" + scale_fill_gradient(low='yellow', high='red')"
]
},
{
Expand All @@ -70,9 +72,27 @@
"outputs": [],
"source": [
"ggplot(data) \\\n",
" + geom_livemap(aes(x='lng', y='lat', sym_x='order', sym_y= 'val', fill='val'), symbol='bar', size=50) \\\n",
" + scale_fill_hue(h = [0.,120.], name = 'order')"
" + geom_livemap(aes(x='lon', y='lat', sym_x='order', sym_y='val', fill='val'), symbol='pie', size=32, color='orange') \\\n",
" + scale_fill_gradient(low='yellow', high='red') + ggsize(600,200)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ggplot(data) \\\n",
" + geom_livemap(aes(x='lon', y='lat', sym_y='val', fill='val'), symbol='pie', size=32, color='orange') \\\n",
" + scale_fill_gradient(low='yellow', high='red') + ggsize(600,200)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down