Showing posts with label Contour. Show all posts
Showing posts with label Contour. Show all posts

Combine three 2D colorap in one figure using Python and Matplotlib.pyplot


The result is:
If you want to plot three 2D colormaps on one figure, the only feasible way is combining these three colormaps to one image. This can be achieved by corresponding three values to three primary elements, i.e. red, green, blue. However, interpretation of the completed figure is quite complex, and easiness of understanding for readers would be decreased. In my opinion, this way for plotting should be avoided.

If you want to plot three 2D colormaps on one figure, the only feasible way is combining these three colormaps to one image. This can be achieved by corresponding three values to three primary elements, i.e. red, green, blue. However, interpretation of the completed figure is quite complex, and easiness of understanding for readers would be decreased. In my opinion, this way for plotting should be avoided.


Listing up sequential 2D colormap with one common colorbar using python and matplotlib.pyplot


The concept is:

Listing up sequential 2D colormap with one common colorbar using python and matplotlib.pyplot

When you want to show a 2D colormap in a sequence, the simplest way to do it is just listing up the output figure like the left side of the above image. However, common information, that is xticks and colorbars, should be omitted to show useful colormap as large as possible. This page shows how to align 2D colormaps without useless information. Three figures are drawn sequentially: 1. full image, 2. without colorbar, and 3. witiout colorbar and xticks. A standalone colorbar will be drawn, plotted and saved at the first iteration of the sequence. By properly selecting the output figure on your tools such as LaTex or Microsoft Office, you can obtain the figure like the right side of the above image.

Two-dimensional interactive contour plot with colorbar using Python and Bokeh


The result is:

Two-dimensional interactive contour plot with colorbar using Python and Bokeh

Add linear colorbar to the contourf using Python and Bokeh.

Two-dimensional interactive contour plot using Python and Bokeh


The result is:

Two-dimensional interactive contour plot using Python and Bokeh

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.

Combine two contourf and one colorbar into one figure using Python and matplotlib.pyplot


The result is:
Combine two contourf and one colorbar into one figure using Python and matplotlib.pyplot

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:

Plot contour figure from data which has large scale and plus-minus difference with minimum limit using Python and matplotlib.pyplot

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.

Combine two contourf and two colorbar into one figure using Python and matplotlib.pyplot


The result is:

Combine two contourf and two colorbar into one figure using Python and matplotlib.pyplot

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:
Combine multiple line plot and contour plot with a colorbar using Python and matplotlib.pyplot

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.

Speed up generating figures by running external python script parallelly using Python and matplotlib.pyplot


The result is:

Speed up generating figures by running external python script parallelly using Python and matplotlib.pyplot

This page shows my suggestion to process data and generate figure parallelly by running some external python script.

Plot contour figure from data which has large scale and plus-minus difference using Python and matplotlib.pyplot


The result is:

Plot contour figure from data which has large scale and plus-minus difference using Python and matplotlib.pyplot modified

This page shows my suggestion to generate contour figure from data which has large scale and plus-minus difference using python and matplotlib.pyplot.

Draw flow past cylinder with continuous stream line using Python Matplotlib.pyplot


The result is:


This page shows how to plot air flow past a cylinder with continuous streamline or how to plot vecter field with continuous streamline. The air flow i.e. vecter field is calculated using COMSOL Multiphysics.

Plot electric field lines around a point charge with grounded sphere using Python Matplotlib.pyplot


The result is :


This page shows the method to draw electric field line around a point charge adjecent to a grounded sphere using method of image charges.

Draw electric field lines due to point charges using Python Matplotlib.pyplot


The results are:


and


This code shows how to visualize streamlines with continuous lines using python and matplotlib.pyplot.

When you search "electric field lines python" or something in Google, you would see the images which use the streamplot. Although it is easy way to visualize the direction of the vector fields, electric field must be continuous lines as you know. In this page, electric field lines around the point charges are calculated using scipy.ode (ordinary differential equations) module.

This code is based on following wonderful tips blog posts: