12 ms·
Dexplot: Python library for data visualization
- The_Amp_Walrus 6y agoIt's not clear how this API works from scanning the docs, but nested in there is a key point: > A matplotlib figure object is returned [from each plot function]
- hprotagonist 6y agoOf the "we really don't like matplotlib syntax, really do want to live in dataframes all the time, so we wrapped mpl and pandas" plotting libraries, plotnine has impressed me the most by far: https://plotnine.readthedocs.io/en/stable/ https://plotnine.readthedocs.io/en/stable/ plotnine is an implementation of a grammar of graphics in Python, it is based on ggplot2. The grammar allows users to compose plots by explicitly mapping data to the visual objects that make up the plot.
- uoaei 6y agoWhat makes you choose this over something like seaborn?
- voxelghost 6y agoNot parent, obv. But the syntax (or grammar if you like) although jarring at first, is starting to grow on me. I am not fully onboard yet, but it is an interesting idea.
- hantusk 6y agoI'm really fond of https://altair-viz.github.io/ https://altair-viz.github.io/ which wraps and translates into https://vega.github.io/vega-lite/ https://vega.github.io/vega-lite/. The interactivity and cross-filtering possibilities is really good when you have many datapoints. From vega-lite I miss that they did not develop object constancy (https://bost.ocks.org/mike/constancy/ https://bost.ocks.org/mike/constancy/) animation possibilities since they're building on top of d3.js.
- stevesycombacct 6y agoI'm a big fan of Altair and have used it for demos in the past. However, restrictions such as a 5,000-row limit on dataframes and usage only inside notebooks pushes me to other solutions like Plotly.
- pea 6y agoBTW, the 5000 restriction is more a "guide" for structuring your data - you can turn it off. Also, Altair plots can certainly be used outside of notebooks! Happy to share some examples..
- stevesycombacct 6y agoPlease, I couldn't find a straightforward configuration to do that
- Myrmornis 6y agoIt looks like this one is designed specifically to be easy to learn and remember. It looks very useful to me for people who make plots less frequently.
- globular-toast 6y agoWhen I was in the business of making plots, ggplot2 was by far my favourite. It seemed odd at first, but eventually it clicked and it felt great. Once you grok the grammar of graphics you'll find you can really quickly express all kinds of plots from any given dataset. I would routinely impress people with how quickly I could visualise data.
- S3L 6y agoI am a bit confused why we need another additional package instead of working with seaborn and implement the changes in there. In my business, we have a lot of test data on a database, where everyone uses their own python-based solutions for plotting, mostly done in a Jupyter notebook. Guess what, to compare results and have one dedicated style-guide for the project, you create more complexity than needed. -> I tried Orange3 for a while, which has a really intuitive way to use, but I miss the direct connection to a DB. Any advice warmly welcome :-)
- TedPetrou 6y agoHey there, I'm the author of Dexplot. There are many issues I had with seaborn • Not allowed to set figure size • No wrapping of tick labels • No strings for pandas aggregation functions • No automatic ordering of x/y labels (dexplot provides several options) • Having to use separate grid functions (catplot, lmplot) for multiple subplots • Something like 5 different functions for scatterplots. Dexplot has one • No relative frequency bar charts, which are a fantastic way to explore data. Dexplot provides normalization over any set of variable • No stacked bar charts • Seaborn docs have distribution plots (box, violin) in the "categorical" section. A major distinction needs to be made between plots that aggregate, show distributions, and those that plot raw data (like scatterplots) • Returning of matplotlib axes or seaborn grid objects. Dexplot always returns the matplotlib figure • Seaborn is essentially dead as far as I can tell with few changes in the last 2-3 years. There are even parameters that continue to be non-functional In the future, Dexplot will add: • Many more plotting functions • Several apps (built from ipywidgets) to explore data. Currently, there is one for viewing colors • Better automatic figure sizing (it exists now, but will be improved) • Automatic DPI detection so that matplotlib inches correspond to actual screen inches Dexplot aims to be very intuitive, easy to use, consistent, and allow easy exploration (the name is a smashing together of data exploration plotting).
- karxxm 6y agoAgain a static default plot library? I would love to see some libraries with higher level visualizations like parallel coordinates, star coordinates and so on. I know, they require interaction, but hey ... why not spending time on this and not again a default plot library? Bar plot stays a bar plot, doesn't matter if you plot it with mpl or seaborn or whatever.
- AlphaSite 6y agoPlotly is pretty great for that sort of thing. It has those sorts of things built in.
- hannibalhorn 6y agoAnd for those who missed the announcement, plotly is now an open source library (it used to be a web service where you needed an API key and had to upload data to their servers, etc.) You still get all the "polish" (nice docs, consistent API, examples, etc.) that went into it when it was a commercial product.
- watwatinthewat 6y agoThanks for this! I dropped plotly due to having projects on machines wtihout an internet connection. Have to try it again.
- nicolaskruchten 6y agoThanks for mentioning this! If people are curious, here's the official announcement: https://medium.com/plotly/plotly-py-4-0-is-here-offline-only-express-first-displayable-anywhere-fc444e5659ee https://medium.com/plotly/plotly-py-4-0-is-here-offline-only...
- jwilber 6y agoThe facet options with the simple “split” arguments look quite nice.
- joshlk 6y agoI personally find the Python plotting landscape a mess and confusing. It always seems to be a lot harder than is necessary to do anything and make it look good.
- zmmmmm 6y agoyes ... I feel like everyone is stuck in a local minima (or maxima, depending on your optimisation direction!) of using matplotlib which is "good enough" but not very good. So there isn't great momentum to improve it, but nobody really likes it. My favorite plotting syntax is that exposed in BeakerX [1], but that's less common than everything else put together. [1] https://github.com/twosigma/beakerx https://github.com/twosigma/beakerx
- captnswing 6y agoI agree! I found this presentation invaluable in getting a good overview of the landscape and the different segments within: https://www.youtube.com/watch?v=FytuB8nFHPQ https://www.youtube.com/watch?v=FytuB8nFHPQ It helped me settle on https://altair-viz.github.io/ https://altair-viz.github.io/ (coming from matplotlib) and I never looked back
- pea 6y agoI find the big benefit of Altair is that the API is so nice and composable, and because vega provides a ton out of the box to build really high quality visualisations. For instance, if you take this (sample) report using Altair to plot Default Alive / Default Dead: https://datapane.com/leo/reports/startup_finance_report/ https://datapane.com/leo/reports/startup_finance_report/ - the interactive code is actually relatively small: https://gist.github.com/lanthias/5a41c1e4b21ae274ddb95cf5ad10b4ac https://gist.github.com/lanthias/5a41c1e4b21ae274ddb95cf5ad1... It's also great being able to add Altair shapes to Folium for geoplotting (as the vega geoplotting is a bit more low-level). What I really think is missing in the ecosystem is a "vega for tables", so you could be rich, interactive tables with a similar grammar. That would rock.
- gmtx725 6y agoyep- far too many libraries. Matplotlib, seaborn, bokeh, plotly, altair, ggplot2, vega, now this. And each library covers about 90% of your use cases on its own but you're constantly having to switch to another one for the remaining 10%. Nightmare.
- hmcamp 6y agoI love the simplicity
- stared 6y agoI don't want to be too snarky, but "beautiful data visualizations" does not go well with typographic errors on the example pages: - overlap of label - HTML tables overlapping the right many bar
- TedPetrou 6y agoLabels do not overlap and HTML tables are now fixed in the docs.
- peteradio 6y agoMight want to change your grid settings so site makes better use of large screen real estate. The plots are overflowing under the right side nav.
- rrggrr 6y agoWithout PDF output it's a chore to share visualizations over email, chat, etc. The uncharted aspect of data visualization is reporting and sharing IMHO.
- pea 6y agoHey, that's what we do at Datapane! https://docs.datapane.com/tutorials/tut-creating-a-report https://docs.datapane.com/tutorials/tut-creating-a-report - you can create a standalone HTML report which contains interactive tables and plots. You can also publish this to the web (https://datapane.com/leo/reports/stock_report_5d2925b9/ https://datapane.com/leo/reports/stock_report_5d2925b9/), embed it into social media (https://medium.com/@leo_26134/embedding-with-datapane-366e60434b5f https://medium.com/@leo_26134/embedding-with-datapane-366e60...), or deploy your Jupyter Notebook or Python script so that other people can run them with parameters to generate reports dynamically. It's still pretty new, so if there's anything you'd like to see, give me a shout at leo [at] datapane.com.
- wodenokoto 6y agoThe same creators have a few other interesting packages on the same site. The dexplo package (a dataframe libray) also sounds really interesting. They also have a barchart race, which looks like an excellent way to get to the front page of Reddit's r/dataisbeautiful
- TedPetrou 6y agoThanks! The whole goal of dexplo and dexplot is to provide a much simpler and more consistent alternative to pandas/seaborn. I find pandas especially cumbersome to work with. I haven't had time to develop dexplo much, but am hoping for a first major release this year.
- themoops36 6y agoHow do people feel about Plotly? I've been using it for years and by far it's been the easiest plotting library (while still being really flexible). The company is very active in developing, for example recently adding plotly_express, which lets me get charts with one liners like: px.line(df, x='x_column', y='y_column') I'm not affiliated with Plotly but just curious what people think since I find it to be an awesome library but I rarely hear about it or meet people who use it.
- akbo 6y agoI love it! What I always missed in, e.g., matplotlib, is the interactivity. I need to be able to zoom in and out without changing code. Hover information is another great feature coming to mind.
- klmadfejno 6y agoLast I checked I was only 99.9% sure that nothing was ever being sent to plotly servers. I needed it to be 100%, not even possible for that to happen. edit: but due to this post I checked again and it seems this is no longer an issue. So +1 to plotly.
- nicolaskruchten 6y agoYes, here's the official word on this, under "Can I use Plotly for Python offline, without being connected to the internet?" https://plotly.com/python/is-plotly-free/ https://plotly.com/python/is-plotly-free/
- klmadfejno 6y agoIn past versions, although free, it's default settings would try to ping their servers. You had to manually set offline mode to False.
- TedPetrou 6y agoHey everyone, I'm the author of Dexplot. I have written large sections of books on seaborn, have taught it in classes for years, and had many issues with it, some of which are outlined below: • Not allowed to set figure size • No wrapping of tick labels • No strings for pandas aggregation functions • No automatic ordering of x/y labels (dexplot provides several options) • Having to use separate grid functions (catplot, lmplot) for multiple subplots • Something like 5 different functions for scatterplots. Dexplot has one • No relative frequency bar charts, which are a fantastic way to explore data. Dexplot provides normalization over any set of variables • No stacked bar charts • Seaborn docs have distribution plots (box, violin) in the "categorical" section. A major distinction needs to be made between plots that aggregate, those that show distributions, and those that plot raw data (like scatterplots) • Returning of matplotlib axes or seaborn grid objects. Dexplot always returns the matplotlib figure • Seaborn is essentially dead as far as I can tell with few changes in the last 2-3 years. There are even parameters that continue to be non-functional In the future, Dexplot will add: • Many more plotting functions • Several apps (built from ipywidgets) to explore data. Currently, there is one for viewing colors • Better automatic figure sizing (it exists now, but will be improved) • Automatic DPI detection so that matplotlib inches correspond to actual screen inches Dexplot aims to be very intuitive, easy to use, consistent, and allow easy exploration (the name is a smashing together of data exploration plotting). Here is one example comparison between dexplot and seaborn. https://twitter.com/TedPetrou/status/1271436948721328129 https://twitter.com/TedPetrou/status/1271436948721328129 Examples such as these are what drove me to create the library. I'd love to get feedback and happy to take detailed criticism.
- watwatinthewat 6y agoGiven this, would you say your goal with Dexplot is to be a better Seaborn (and replace it given its dev state), basically the same usage cases but with improvements as you describe? Thanks for the effort. Looks like a great project.
- TedPetrou 6y agoCorrect, I'd like dexplot to be a superset of seaborn first, making it much easier to use for those that don't want to dip into matplotlib for making minor adjustments that are necessary for most plots (figsize, ticklabels, etc..). There should be a library to do exploratory data analysis quickly, without having to touch matplotlib, numpy, or pandas, and without installing something like pandas-profiling to make reports. This is where the apps will come in to allow users to quickly generate reports on things like missing values, duplicate rows/columns, outliers/bad data, view different colors, etc...
- heybrendan 6y agoThank you for sharing. I'm curious, how does this compare to Chartify [1]? Note, I am not affiliated with Spotify or the Chartify team. [1] https://github.com/spotify/chartify https://github.com/spotify/chartify
- bede 6y agoGreat work. This is easily among the most elegant Python plotting APIs for exploratory data analysis. Seaborn is a fantastic tool but I sympathise with the author's frustrations with it. Excellent documentation, but as others have said docs are everything with charting, so expanding that and adding a gallery are probably the best ways to get people onboard. Looking forward to giving this a try.