Pcolor with cut data below lower limit using Python and matplotlib.pyplot
The result is:
This page shows how to generate pcolor graph with a data whose small values below minimum limit are cut using python and matplotlib.
Convert x value to symlog scale with zero shift using Python and matplotlib.pyplot
The result is:
This code shows how to convert x value to symlog scale with zero shift using Python and matplotlib.pyplot
Two ways to align ylabels for two plots using Python and matplotlib.pyplot
The result is:
This page shows two ways to align two ylabels for two subplots using Python and matplotlib.pyplot.
Generate figure with just only table using Python and matplotlib.pyplot
The result is:
This code shows how to generate a figure with just only a table using Python and matplotlib.pyplot
Generate network graph using Python and matplotlib.pyplot
The result is:
This page shows how to generate network graph using Python, matplotlib.pyplot and networkx.
Combine two figures with/without spines and ticks using Python and matplotlib.pyplot
The result is:
This code shows how to combine two figures with and without spines and ticks using Python and matplotlib.pyplot.
Remove ticks and spines (box around figure) using Python and maptlotlib.pyplot
The result is:
This page shows how to remove ticks and spines (box around figure) using Python and matplotlib.pyplot.
Interactive figure with several 1D plot and one hovertools using Python and Bokeh
The result is:
This code how to generate interactive figure with several 1D plot, one hovertools and togglable legend using Python and Bokeh. This is a continuing post of last one.
Interactive figure with several 1D plot and several hovertools using Python and Bokeh
The result is:
This page shows how to generate interactive figure with several 1D plot and several hovertools using Python and Bokeh. The way to merge hovertools will be shown in the next post.
Interactive 1D time-scale plot with hovertool using Python and Bokeh
The result (static image) is:
This page shows how to generate interactive time-scale 1D line plot with hovertool (stock data) using Python and Bokeh.
Two-dimensional interactive contour plot using Python and Bokeh
The result is:
Bokeh is powerful plotting tools using nodejs. Although this code doesn't use matplotlib, I want to introduce how to generate 2D interactive contour plot using Bokeh.
Interactive plot using Bokeh - first step -
The result (static image) is:
I firstly thought that Bokeh uses matplotlib. We generate figure using matplotlib then convert the figure to the Bokeh compatible. However, it seems Bokeh works stand alone without matplotlib (is it true?) Anyway, let's check whether Bokeh works in my environment or not.
Interactive time-scale stock price figure using Python, matplotlib.pyplot and mpld3
The result (static image) is:
This page shows how to generate interactive figure using python, matplotlib.pyplot and mpld3. The stock information of the apple.inc is used as the example to plot.
Interactive figure with interactive legend using Python, matplotlib.pyplot and mpld3
The result (static image) is:
This page shows how to plot data in interactive figure using python, matplotlib.pyplot and mpld3. A interactive legend is added to the figure.
Animate 3D wireframe using animation.FuncAnimation in Python and maptlotlib.pyplot
The result is:
This page shows how to animate 3D wireframe figure using animation.FuncAnimation in Python and matplotlib.pyplot.
Labels:
3D,
Animation,
FuncAnimation,
Matplotlib,
Python,
Toolkit
Generate animation of 3D surface plot using plot_surface and animation.ArtistAnimation in Python and matplotlib.pyplot
The result is:
This page shows how to generate an animation of 3D surface plot using plot_surface and animation.ArtistAnimation in python and matplotlib.pyplot.
Labels:
3D,
Animation,
ArtistAnimation,
Matplotlib,
Python,
Toolkit
Generate animation of 3D surface plot using plot_surface and animation.FuncAnimation in Python and matplotlib.pyplot
The result is:
This page shows how to generate an animation of 3D surface plot using plot_surface and animation.Funcanimation in python and matplotlib.pyplot.
Labels:
3D,
Animation,
FuncAnimation,
Matplotlib,
Python,
Toolkit
Generate 3D scatter animation using animation.FuncAnimation in Python and matplotlib.pyplot
The result is:
This page shows how to generate 3D animation of scatter plot using animation.FuncAnimation, python, and matplotlib.pyplot.
Labels:
3D,
Animation,
FuncAnimation,
Matplotlib,
Python,
Scatter
Generate normalized stacked barplot with sample number and percentage using Python and matplotlib.pyplot
The result is:
This page shows how to generate normalized stacked barplot with sample number of each bar and percentage of each data using python and matplotlib.pyplot.
Add sample number to stacked barplot using Python and matplotlib.pyplot
The result is:
This page shows how to add sample number to stacked barplot using Python and matplotlib.pyplot.
Combine two contourf and one colorbar into one figure using Python and matplotlib.pyplot
The result is:
This page shows how to combine two contourf and one colorbar into one figure using python and matplotlib.pyplot.
Plot contour figure from data which has large scale and plus-minus difference with minimum limit using Python and matplotlib.pyplot
The result is:
This page shows my suggestion to generate contour figure from data which has large scale and plus-minus difference using python and matplotlib.pyplot. The minimum value and maximum value can be specified in this code.
Labels:
Color,
Contour,
Label,
Log,
Matplotlib,
Python,
Simulation,
Symlog
Increase box size of the legend for barplot using Python and matplotlib.pyplot
The result is:
This page shows how to increase box size of the legend for barplots using Python and matplotlib.pyplot.
Decrease padding around annotation text using Python and matplotlib.pyplot
The result is:
When you struggle to draw efficient figures, you sometimes think the padding around the annotation text is to big. This page shows how to decrease the padding around the annotation text using python and matplotlib.pyplot.
Combine two contourf and two colorbar into one figure using Python and matplotlib.pyplot
The result is:
This page shows how to combine two contourf and two colorbar into one figure using python and matplotlib.pyplot.
Combine multiple line plot and contour plot with a colorbar using Python and matplotlib.pyplot
The result is:
This code shows how to combine multiple line plots and contour plots with a colorbar in one figure using Python and matplotlib.pyplot. To combine these plots, plt.subplots with gridspec_kw options are used. The xlims are also adjusted between upper and lower plots.
Animate zoomed plot of crowded data by updating xlim using matplotlib.animation.FuncAnimation
The result is:
This code shows how to animate the zoomed subplot of original crowded subplot using Python and matplotlib.animation.Funcanimation.
Labels:
Animation,
FuncAnimation,
Matplotlib,
Python,
Simulation
Speed up generating figures by running external python script parallelly using Python and matplotlib.pyplot
The result is:
This page shows my suggestion to process data and generate figure parallelly by running some external python script.
Labels:
Contour,
Matplotlib,
Parallel,
Python,
Simulation,
SpeedUp
Plot contour figure from data which has large scale and plus-minus difference using Python and matplotlib.pyplot
The result is:
This page shows my suggestion to generate contour figure from data which has large scale and plus-minus difference using python and matplotlib.pyplot.
Labels:
Color,
Contour,
Label,
Log,
Matplotlib,
Python,
Simulation,
Symlog
Plot 1D data which has large scale and plus-minus difference using Python and matplotlib.pyplot
The result is:
This page shows my suggestion to generate 1D line figure from data which has large scale and plus-minus difference using python and matplotlib.pyplot.
Rotate azimuth angle and animate 3d plot_surface using Python and matplotlib.pyplot
The result is:
This page shows how to generate animation with rotating azimuth angle in the 3D surface plot using python, matplotlib.pyplot, and matplotlib.animation.FuncAnimation.
Labels:
3D,
Animation,
FuncAnimation,
Matplotlib,
Python,
Toolkit
Rotate elevation angle and animate 3d plot_surface using Python and matplotlib.pyplot
The result is:
This page shows how to generate animation with rotating elevation angle in the 3D surface plot using python, matplotlib.pyplot, and matplotlib.animation.FuncAnimation.
Labels:
3D,
Animation,
FuncAnimation,
Matplotlib,
Python,
Toolkit
Compare plt.plot and plt.scatter in speed in Python and Matplotlib.pyplot
This page compares the speed of "plt.plot" and "plt.scatter" to generate same following figure:
It seems that "plt.plot" is faster than "plt.scatter" to plot simple and large point scatter plot.
Kernel density estimation using Python, matplotlib.pyplot and scipy.stats.gaussian_kde
The result is:
This page shows how to change the color of the scatter point according to the density of the surrounding points using python and scipy.stats.gaussian_kde and matplotlib.
Check the url is indexed by Google using Python
Indexed by Google is crucial to increase the number of the visitor to the site. You can check whether the URL is indexed by Google or not using Python. This page shows how to do it for all blog posts. The URLs of the blog posts are extracted from the sitemap. So, you can use this code for your page by just modifying the sitemap URL. If you know how to use Heroku, crontab or such light resources which enable regularly execution of scripts, and if you know how to send an e-mail using python, you can report the indexed/not-indexed page for hourly, daily, weekly or whenever you want. The notebook below is the example of the indexed/not-indexed URL list when this post is written.
Add second x-axis below first x-axis using Python and matplotlib.pyplot
The result is:
This page shows how to draw second x-axis below the first x-axis. Using "twinx", "set_ticks_position", and "set_label_position", and "spines['bottom'].set_position", you can move the second x-axis from the top of the figure to below the first x-axis.
Add second x-axis at top of figure using Python and matplotlib.pyplot
The result is:
This page shows how to add second x-axis at the top of the figure using python and matplotlib.pyplot. Using "twinx" funcion, you can add x-axis at the top of the figure.
Solve and animate single pendulum using scipy.odeint and matplotlib.animation.ArtistAnimation
The result is:
This page shows the example of the scipy.odeint function with solving the motion of the single pendulum. The result is converted to the animation using matplotlib.animation.ArtistAnimation.
Labels:
Animation,
ArtistAnimation,
Matplotlib,
Ode,
Python,
Simulation
Try using all mathtext fontset in python and matplotlib.pyplot
The result (computer modern: cm) is:
In this page, I try using all mathtext fontset in python and matplotlib.pyplot. It seems that the resulting text of \mathbb{hogehoge}, \mathrm{\mathbb{hogehgoe}}, \mathfrak{hogehoge}, \mathsf{hogehoge}, and \mathrm{\mathsf{hogehoge}} are same.
Generate average image using Python and PIL (Python Image Library)
This page shows how to generate an average image of the image arrays using python and PIL (python image library) module.
It is easy to do by converting the image to the numpy.array.
Combine 3D and two 2D animations in one figure using python, matplotlib.pyplot and animation.ArtistAnimation
The result is:
This page shows how to combine 3D and 2D animations in one figure using python, matplotlib.pyplot, and animation.artistanimation function.
Labels:
3D,
Animation,
ArtistAnimation,
Matplotlib,
Python,
Toolkit
Combine 3D and two 2D animations in one figure using python, matplotlib.pyplot and animation.timedanimation
The result is:
This page shows how to combine 3D and 2D animations in one figure using python, matplotlib.pyplot, and animation.timedanimation function.
Combine two 2D animations in one figure using python, matplotlib.pyplot and animation.artistanimation
The result is:
This code shows how to combine two 2D animations in one figure using python, matplotlib.pyplot, and matplotlib.animation.
Combine two 2D animations in one figure using python, matplotlib.pyplot and animation.timedanimation
The result is:
This code shows how to combine two 2D animations in one figure using python, matplotlib.pyplot, and matplotlib.animation.
Plot three wave in one plot; PWM wave as example
The result is:
This page shows an example of a plot with three waves in one axes using offsets. The PWM wave is the objective.
Subscribe to:
Posts (Atom)