holtzy / the-python-graph-gallery Goto Github PK
View Code? Open in Web Editor NEWA website displaying hundreds of charts made with Python
Home Page: https://www.python-graph-gallery.com
License: BSD Zero Clause License
A website displaying hundreds of charts made with Python
Home Page: https://www.python-graph-gallery.com
License: BSD Zero Clause License
I came across your document on the web regarding the Basic Circle Packing Chart. You stated that the second column (Value) of the dataframe will control the bubble size. But from the chart created, it seems like the value didn’t control the size cause D is way smaller than F and the other circles are not scaled proportionately. May I know how do i make the size of the bubbles based on the value?
ERROR: GeodError: inv_intermediate: npts and del_s are mutually exclusive, only one of them must be != 0.
This is happening, because when compiling, there are equal points being compiled, and therefore there is no possibility of plotting the line that interconnects the points. As the image below:
image.png
Solution suggestion.
for startIndex, startRow in df.iterrows():
for endIndex in range(startIndex, len(df.index)):
endRow = df.iloc[endIndex]
if startRow.city == endRow.city:
pass
else:
m.drawgreatcircle(startRow.lon, startRow.lat, endRow.lon, endRow.lat, linewidth=1, color='#69b3a2');
Hope this helps.
Hi there, thanks for providing this useful resource!
Half a year ago I was really excited to find https://github.com/has2k1/plotnine , the first really usable ggplot2 implementation in Python. The implementation is so close to ggplot2 that one can even use the ggplot2 tutorials and manual almost 1:1.
The gallery provides many nice examples of the usage: https://plotnine.readthedocs.io/en/stable/gallery.html
Maybe it would be helpful to add these examples to the Python graph gallery?
Dear Yan Holtz:
Sorry to bother you!
I am writing to ask for your help with the file from this file.
https://python-graph-gallery.com/wp-content/uploads/mtcars.csv
It seems that this file is no longer there. Could you please send me this csv file?!
I am trying to do some heatmap clustering with dendrogram and needs some help and example.
Your help will be most appreciated and have a nice day!
Time spirals are cool! You should consider adding them to the site (which I BTW really like).
Source (PDF, page 6)
see density section for a start. Much more to do.
https://www.python-graph-gallery.com/12-stacked-barplot-with-matplotlib
This URL lead to an empty blogpost on safari on the 2/9/2021
Missing example.
See the R equivalent for inspiration
https://www.r-graph-gallery.com/circular-barplot.html
Hi, please let me promote my developing library.
You mentioned, "The most common library like Matplotlib and Seaborn will not be of any help to build one." on your website.
However, I manage and develop pyCircos that allow drawing circos plots (chord diagrams).
The library is implemented based on matplotlib, so the drawn object can be customized in a general matplotlib manner.
The following example plot is generated by using pyCircos.
If you are interested in pyCircos, please try to execute the example code on Google colab.
I would like to be glad if you could introduce pyCircos on your website.
Hi and thanks for the very useful resource.
I think you’re a little short on sankey options, there’s only matplotlib which is a little basic/ugly. Could consider adding maybe pySankey ?
I don’t know if there are other decent options, there’s floweaver (previously pysankeyview), but it apparently requires other packages such as ipansankeywidget
to be displayed.
Hello! There is not the example data for the "dendrogram with heat map" page :(
https://www.python-graph-gallery.com/404-dendrogram-with-heat-map
In reference to:
https://python-graph-gallery.com/174-change-background-colour-of-venn-diagram/
Following line uses deprecated feature and throws an error:
plt.gca().set_axis_bgcolor('skyblue')
The following works:
plt.gca().set_facecolor('skyblue')
Jet is bad, so it shouldn’t prominently appear in the gallery (e.g. here). The new default viridis should step in nicely.
The maps section still has a basemap subtitle in it, however basemap has been deprecated. Do you plan on replacing this with cartopy?
See https://scitools.org.uk/cartopy/docs/latest/ for more on the cartopy project and https://matplotlib.org/basemap/ for the basemap deprecation notice.
Hi,
Thanks for a great resource. Today I discovered that the chord charts have been removed from Bokeh, and moved to bkcharts. However they are unmaintained, and the example no longer works.
Brad
Add a section in the matplotlib page. Add 26 buttons for the 26 matplotlib prebuilt themes. Clicking on a button should show the theme result in a plot below.
Note that post #199-matplotlib-style-sheets is dedicated to matplotlib themes
Not sure if you're aware of Altair, but it does have a streamgraph implementation available:
https://altair-viz.github.io/gallery/stacked_area_stream.html
Observing https://github.com/holtzy/The-Python-Graph-Gallery/blob/master/src/notebooks/327-network-from-correlation-matrix.ipynb
With reference to WestHealth/pyvis#123 and
Instead of using thresholds, is it possible to simply weight the connections between 0 and infinity?
On this page, anything under 0.3 makes negligible correlation, and anything over 0.9 is clearly correlated, with 0.6 being the middle of correlation significance. Possibly, for scaling purposes (where 0 correlation leads to 0 weight, and 0.6 correlation leads to 1, 1 correlated to b^0.583):
from numpy import tanh, exp
def scale(x):
return exp(tanh((x-0.6)/0.6))
The link that leads to
Under the "Altair" heading, there is a link to the code "for the adjacent figure." That link returns a 404. Here is the broken link:
https://altair-viz.github.io/gallery/stacked_area_stream.html
I believe the link should point to the following page instead:
https://altair-viz.github.io/gallery/streamgraph.html
A Histogram represents the distribution of a numeric variable
Histograms are commonly used for any kind of variable including non-numeric, i.e. categorical variables.
On the following page (https://www.python-graph-gallery.com/barplot) the section 'Stacked and Grouped barplot with Matplotlib' has images and links switched between stacked and grouped barplot.
Hi
Preparing the content for a talk I gave in data visualization with python, I reproduced the stack area chart from an article published by The New York Times: "How Severe Is the Western Drought? See For Yourself."
To contribute to the gallery, I need to write a blog post like the following? https://www.python-graph-gallery.com/web-ggbetweenstats-with-matplotlib
best,
Cristóbal
If you're aware of any tip to build it, please let me knwo!
I built and maintain a python library for network visualisation called netgraph.
Netgraph accepts igraph
and networkx
Graph
objects as input (as well as many other sensible data structures to represent graphs in python).
For edge bundling, netgraph implements the FDEB algorithm proposed by Holten & Wijk (2009).
Example visualization that combines a modular node layout with edge bundling:
import matplotlib.pyplot as plt
import networkx as nx
from netgraph import Graph # pip install netgraph
# create a modular graph
partition_sizes = [10, 20, 30, 40]
g = nx.random_partition_graph(partition_sizes, 0.5, 0.1)
# position nodes according to their community using the `community` node layout
node_to_community = dict()
node = 0
for community_id, size in enumerate(partition_sizes):
for _ in range(size):
node_to_community[node] = community_id
node += 1
# color nodes according to their community
community_to_color = {
0 : 'tab:blue',
1 : 'tab:orange',
2 : 'tab:green',
3 : 'tab:red',
}
node_color = {node: community_to_color[community_id] for node, community_id in node_to_community.items()}
Graph(g,
node_color=node_color, node_edge_width=0, edge_alpha=0.1,
node_layout='community', node_layout_kwargs=dict(node_to_community=node_to_community),
edge_layout='bundled', edge_layout_kwargs=dict(k=2000),
)
plt.show()
Maybe add .gitignore file to root of project and eliminate .DS_Store
, node_modules
, .vscode
and .ipynb_checkpoints
from repo. They are local files and do not need versioning.
see at Quick Start https://www.python-graph-gallery.com/plotly/
Hello Mr. Holtz,
I just wanted to notify you (in case you did not know) that there is an error in the links found in the section 'Stacked and Grouped barplot with Matplotlib' in https://www.python-graph-gallery.com/barplot/.
So the error is that if you click the stacked barplot image you are redirected to the grouped barplot page, and the same happens for the grouped barplot image, but it redirects you to the stacked barplot page.
Thanks for your amazing work.
Kind regards,
Ricard
I was trying to make the time-serie graph reported on the site:
https://r-graph-gallery.com/318-custom-dygraphs-time-series-example.html
Which loads the following dataframe:
https://python-graph-gallery.com/wp-content/uploads/bike.csv
But I realized the dataframe bike.csv is not longer present in your site. Is it possible to restore?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.