{"id":8745,"date":"2025-12-01T07:02:46","date_gmt":"2025-12-01T07:02:46","guid":{"rendered":"https:\/\/mailitics.com\/index.php\/2025\/12\/01\/ggplotly_a_grammar_of_graphics_implementation_in\/"},"modified":"2025-12-01T07:02:46","modified_gmt":"2025-12-01T07:02:46","slug":"ggplotly_a_grammar_of_graphics_implementation_in","status":"publish","type":"post","link":"https:\/\/mailitics.com\/index.php\/2025\/12\/01\/ggplotly_a_grammar_of_graphics_implementation_in\/","title":{"rendered":"ggplotly &#8211; A Grammar of Graphics implementation in Python\/Plotly"},"content":{"rendered":"<p>    ggplotly &#8211; A Grammar of Graphics implementation in Python\/Plotly<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<!-- SC_OFF --><\/p>\n<div class=\"md\">\n<p><a href=\"https:\/\/github.com\/bbcho\/ggplotly\">https:\/\/github.com\/bbcho\/ggplotly<\/a><\/p>\n<p>As a fun project, I decided to try and replicate ggplot2 in plotly and python. I know that plotnine exists, but I like the interactivity of plotly. Let me know what you think. Coverage isn&#8217;t 100% but you can do most things. I tried to keep the syntax and naming conventions the same. So this should work:<\/p>\n<pre><code>from ggplotly import * import pandas as pd import numpy as np x = np.linspace(0, 10, 100) y = np.random.random(100) df = pd.DataFrame({'x': x, 'y': y}) x = np.linspace(0, 10, 100) y = np.random.random(100) df2 = pd.DataFrame({'x': x, 'y': y}) ( ggplot(df, aes(x='x', y='y')) + geom_line() + geom_line(df2, aes(x='x', y='y', color='red'), name=\"Test\", showlegend=False ) <\/code><\/pre>\n<\/p><\/div>\n<p><!-- SC_ON -->   submitted by   <a href=\"https:\/\/www.reddit.com\/user\/turnipemperor\"> \/u\/turnipemperor <\/a> <br \/> <span><a href=\"https:\/\/www.reddit.com\/r\/datascience\/comments\/1p9wal3\/ggplotly_a_grammar_of_graphics_implementation_in\/\">[link]<\/a><\/span>   <span><a href=\"https:\/\/www.reddit.com\/r\/datascience\/comments\/1p9wal3\/ggplotly_a_grammar_of_graphics_implementation_in\/\">[comments]<\/a><\/span>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    \/u\/turnipemperor<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/www.reddit.com\/r\/datascience\/comments\/1p9wal3\/ggplotly_a_grammar_of_graphics_implementation_in\/\">Go to original source<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ggplotly &#8211; A Grammar of Graphics implementation in Python\/Plotly https:\/\/github.com\/bbcho\/ggplotly As a fun project, I decided to try and replicate ggplot2 in plotly and python. I know that plotnine exists, but I like the interactivity of plotly. Let me know what you think. Coverage isn&#8217;t 100% but you can do most things. I tried to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,99],"tags":[4327,1241,603],"class_list":["post-8745","post","type-post","status-publish","format-standard","hentry","category-aimldsaimlds","category-datascience","tag-ggplotly","tag-np","tag-plotly"],"_links":{"self":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/8745"}],"collection":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/comments?post=8745"}],"version-history":[{"count":0,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/8745\/revisions"}],"wp:attachment":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/media?parent=8745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/categories?post=8745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/tags?post=8745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}