Understanding Matplotlib Scatter

Our analysis in this article will concentrate on the Matplotlib scatter plot and its many features, such as customizing markers, colors, and labels, as well as displaying annotations and legends on the plot.

Matplotlib Scatter Plots – Create One

To create a Matplotlib scatter plot, we use the scatter() function.

It is possible to plot one dot for each data point by calling the Matplotlib scatter() function.

The scatter() function takes two arrays of data as input:

• one for the x-values.
• one for the y-values.

Below are examples of how to create a simple Matplotlib scatter plots.

Generate a basic scatter graph:

Example:

import matplotlib.pyplot as pt import numpy as npy random_fibionacci = npy.array([5, 34, 3, 2, 21, 13, 8]) random_num = npy.array([22,8,37,17,29,3,46]) pt.scatter(random_fibionacci, random_num) pt.show()

Utilize the prime number array in the below example:

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([74,3,61,22,5,39,16,41,19,35,51]) prime = npy.array([17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59]) pt.scatter(random_num, prime) pt.show()

In the example above, there are 11 numbers that make up the Matplotlib scatter.

Random numbers are plotted along the X-axis.

Prime numbers are plotted on the Y-axis.

The scatter plot indicates that there is no clear connection between the random_num values and the prime values.

Now Compare Plots

In the Matplotlib scatter example above, there looks not to be a relationship between prime numbers and random numbers, but what if we display results from another day?

What else can we learn from the scatter plot?

Utilize the prime number array in the below example:

Example:

import matplotlib.pyplot as pt import numpy as npy#graph1 random_fibionacci = npy.array([5, 34, 3, 2, 21, 13, 8]) random_num = npy.array([22,8,37,17,29,3,46]) pt.scatter(random_fibionacci, random_num) #graph2 random_fibionacci = npy.array([13, 5, 2, 8, 21, 34, 3, 1]) random_num = npy.array([10,87,54,33,47,21,13, 5]) pt.scatter(random_fibionacci, random_num) pt.show()

Utilize the prime number array in the below example:

Example:

import matplotlib.pyplot as pt import numpy as npy#graph1 random_num = npy.array([74,3,61,22,5,39,16,41,19,35,51]) prime = npy.array([17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59]) pt.scatter(random_num, prime) #graph2 random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) pt.scatter(random_num, prime) pt.show()
Reminder: The two graphs are displayed with two distinct colors, by default blue and orange. You will find out how to modify the colors after exploring Matplotlib scatter later in this chapter.

Matplotlib Scatter Colors

If you’re working with Matplotlib scatter, you can provide your own color through the color or c argument.

You can choose the color of the markers:

Example:

import matplotlib.pyplot as pt import numpy as npy#graph1 random_fibionacci = npy.array([5, 34, 3, 2, 21, 13, 8]) random_num = npy.array([22,8,37,17,29,3,46]) pt.scatter(random_fibionacci, random_num, color = 'Red') #graph2 random_fibionacci = npy.array([13, 5, 2, 8, 21, 34, 3, 1]) random_num = npy.array([10,87,54,33,47,21,13, 5]) pt.scatter(random_fibionacci, random_num, color = 'PowderBlue') pt.show()

In the following example first place the argument c then apply the different color in code form:

Example:

import matplotlib.pyplot as pt import numpy as npy#graph1 random_num = npy.array([74,3,61,22,5,39,16,41,19,35,51]) prime = npy.array([17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59]) pt.scatter(random_num, prime, c = '#d2a679') #graph2 random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) pt.scatter(random_num, prime, c = '#993366') pt.show()

Color Each Dot

With Matplotlib scatter, you can also assign a particular color for each dot by utilizing an array of colors as a value for c argument:

Reminder: Utilizing the color argument will not work, only the c argument will.

Customize each marker color:

Example:

import matplotlib.pyplot as pt import numpy as npy random_fibionacci = npy.array([13, 5, 2, 8, 21, 34, 3, 1]) random_num = npy.array([10,87,54,33,47,21,13, 5]) mrx_colors = npy.array(["yellow","black","orange","purple","beige","gray","cyan","magenta"]) pt.scatter(random_fibionacci, random_num, c = mrx_colors) pt.show()

Provide different colors for data points:

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array(["Maroon","LightSalmon","MidnightBlue","yellow","cyan","magenta","PaleGreen","black","PeachPuff","purple","RebeccaPurple","Lime","gray"]) pt.scatter(random_num, prime, c = mrx_colors) pt.show()

Marker ColorMaps

There are a variety of colormaps accessible in the Matplotlib module OR Matplotlib scatter.

When working with Matplotlib scatter, a colormap is similar to a list of colors with values ranging from 0 to 100.

Colormap example:

In this colormap, we can observe that it ranges from 0, which is a blue color, all the way upto 100, which is a yellow color, and this colormap is known as plasma.

How to Use ColorMap?

Matplotlib offers several built-in colormaps, including ‘plasma‘, which is one of them. The colormap can be provided with the keyword argument cmap.

Moreover, you have to generate an array with values (from 0 to 100), each value per scatter plot point in Matplotlib scatter.

In the scatter graph, construct a color array and provide a colormap:

Example:

import matplotlib.pyplot as pt import numpy as npy random_fibionacci = npy.array([13, 5, 2, 8, 21, 34, 3, 1]) random_num = npy.array([10,87,54,33,47,21,13, 5]) mrx_colors = npy.array([0,15,38,62,25,54,73,86]) pt.scatter(random_fibionacci, random_num, c = mrx_colors, cmap = 'plasma') pt.show()

Implement the cmap argument then utilize the ‘plasma‘ colormap:

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'plasma') pt.show()

If you want to display the colormap in your graph, simply invoke the pt.colorbar() statement when you apply Matplotlib scatter:

Insert the ‘plasma’ colormap bar in the below example:

Example:

import matplotlib.pyplot as pt import numpy as npy random_fibionacci = npy.array([13, 5, 2, 8, 21, 34, 3, 1]) random_num = npy.array([10,87,54,33,47,21,13, 5]) mrx_colors = npy.array([0,15,38,62,25,54,73,86]) pt.scatter(random_fibionacci, random_num, c = mrx_colors, cmap = 'plasma') pt.colorbar() pt.show()

In the following example, display the ‘hsv‘ colormap by applying pt.colorbar():

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'hsv') pt.colorbar() pt.show()

The Matplotlib scatter package comes with a number of built-in colormaps that you can select from.

Here is a list of all 162 built-in colormaps in Matplotlib:

 Color Maps Overview Accent A qualitative colormap with bright colors. Accent_r The reverse of the Accent colormap. Blues A sequential colormap that goes from light to dark blue. Blues_r The reverse of the Blues colormap. BrBG A diverging colormap that goes from brown to green to blue. BrBG_r The reverse of the BrBG colormap. BuGn A sequential colormap that goes from light blue to dark green. BuGn_r The reverse of the BuGn colormap. BuPu A sequential colormap that goes from light blue to dark purple. BuPu_r The reverse of the BuPu colormap. CMRmap A colormap that goes from black to red to yellow to white. CMRmap_r The reverse of the CMRmap colormap. Dark2 A qualitative colormap with dark colors. Dark2_r The reverse of the Dark2 colormap. GnBu A sequential colormap that goes from green to blue. GnBu_r The reverse of the GnBu colormap. Greens A sequential colormap that goes from light to dark green. Greens_r The reverse of the Greens colormap. Greys A sequential colormap that goes from black to white. Greys_r The reverse of the Greys colormap. OrRd A sequential colormap that goes from orange to red. OrRd_r The reverse of the OrRd colormap. Oranges A sequential colormap that goes from light orange to dark orange. Oranges_r The reverse of the Oranges colormap. PRGn A diverging colormap that goes from purple to green. PRGn_r The reverse of the PRGn colormap. Paired A qualitative colormap with paired colors. Paired_r The reverse of the Paired colormap. Pastel1 A qualitative colormap with pastel colors. Pastel1_r The reverse of the Pastel1 colormap. Pastel2 A qualitative colormap with pastel colors. Pastel2_r The reverse of the Pastel2 colormap. PiYG A diverging colormap that goes from pink to green. PiYG_r The reverse of the PiYG colormap. PuBu A sequential colormap that goes from purple to blue. PuBuGn A sequential colormap that goes from purple to blue to green. PuBuGn_r The reverse of the PuBuGn colormap. PuBu_r The reverse of the PuBu colormap. PuOr A diverging colormap that goes from purple to orange. PuOr_r The reverse of the PuOr colormap. PuRd A sequential colormap that goes from purple to red. PuRd_r The reverse of the PuRd colormap. Purples A sequential colormap that goes from light to dark purple. Purples_r The reverse of the Purples colormap. RdBu A diverging colormap that goes from red to blue. RdBu_r The reverse of the RdBu colormap. RdGy A diverging colormap that goes from red to white to blue. RdGy_r The reverse of the RdGy colormap. RdPu A sequential colormap that goes from red to purple. RdPu_r The reverse of the RdPu colormap. RdYlBu A diverging colormap that goes from red to yellow to blue. RdYlBu_r The reverse of the RdYlBu colormap. RdYlGn A diverging colormap that goes from red to yellow to green. RdYlGn_r The reverse of the RdYlGn colormap. Reds A sequential colormap that goes from light to dark red. Reds_r The reverse of the Reds colormap. Set1 A qualitative colormap with distinct colors. Set1_r The reverse of the Set1 colormap. Set2 A qualitative colormap with distinct colors. Set2_r The reverse of the Set2 colormap. Set3 A qualitative colormap with distinct colors. Set3_r The reverse of the Set3 colormap. Spectral A diverging colormap that goes from red to yellow to green to blue. Spectral_r The reverse of the Spectral colormap. Wistia A sequential colormap that goes from light yellow to dark yellow. Wistia_r The reverse of the Wistia colormap. YlGn A sequential colormap that goes from light yellow to dark green. YlGnBu A sequential colormap that goes from light yellow to blue to dark green. YlGnBu_r The reverse of the YlGnBu colormap. YlGn_r The reverse of the YlGn colormap. YlOrBr A sequential colormap that goes from light yellow to dark brown. YlOrBr_r The reverse of the YlOrBr colormap. YlOrRd A sequential colormap that goes from light yellow to dark red. YlOrRd_r The reverse of the YlOrRd colormap. afmhot A sequential colormap that goes from black to red to yellow to white. afmhot_r The reverse of the afmhot colormap. autumn A sequential colormap that goes from red to yellow to brown. autumn_r The reverse of the autumn colormap. binary A colormap that goes from black to white. binary_r The reverse of the binary colormap. bone A sequential colormap that goes from black to white with a blue tint. bone_r The reverse of the bone colormap. brg A colormap that goes from blue to red to green. brg_r The reverse of the brg colormap. bwr A diverging colormap that goes from blue to white to red. bwr_r The reverse of the bwr colormap. cividis A sequential colormap that goes from blue to yellow to green. cividis_r The reverse of the cividis colormap. cool A sequential colormap that goes from cyan to magenta. cool_r The reverse of the cool colormap. coolwarm A diverging colormap that goes from blue to white to red. coolwarm_r The reverse of the coolwarm colormap. copper A sequential colormap that goes from black to brown. copper_r The reverse of the copper colormap. cubehelix A sequential colormap that goes from black to red to yellow to white. cubehelix_r The reverse of the cubeh. flag A colormap that goes from red to white to blue. flag_r The reverse of the flag colormap. gist_earth A sequential colormap that goes from brown to green to blue. gist_earth_r The reverse of the gist_earth colormap. gist_gray A sequential colormap that goes from black to white. gist_gray_r The reverse of the gist_gray colormap. gist_heat A sequential colormap that goes from black to yellow to red. gist_heat_r The reverse of the gist_heat colormap. gist_ncar A qualitative colormap with distinct colors. gist_ncar_r The reverse of the gist_ncar colormap. gist_rainbow A qualitative colormap with distinct colors. gist_rainbow_r The reverse of the gist_rainbow colormap. gist_stern A sequential colormap that goes from blue to white to red. gist_stern_r The reverse of the gist_stern colormap. gist_yarg A sequential colormap that goes from black to white with a blue tint. gist_yarg_r The reverse of the gist_yarg colormap. gnuplot A sequential colormap that goes from yellow to red to purple. gnuplot2 A sequential colormap that goes from blue to green to yellow to red to purple. gnuplot2_r The reverse of the gnuplot2 colormap. gnuplot_r The reverse of the gnuplot colormap. gray A sequential colormap that goes from black to white. gray_r The reverse of the gray colormap. hot A sequential colormap that goes from black to red to yellow to white. hot_r The reverse of the hot colormap. hsv A colormap that goes from red to yellow to green to blue to purple to red. hsv_r The reverse of the hsv colormap. inferno A sequential colormap that goes from black to yellow to red to purple. inferno_r The reverse of the inferno colormap. jet A colormap that goes from blue to green to yellow to red. jet_r The reverse of the jet colormap. magma A sequential colormap that goes from black to purple to pink to yellow. magma_r The reverse of the magma colormap. nipy_spectral A diverging colormap that goes from blue to white to red to yellow to green. nipy_spectral_r The reverse of the nipy_spectral colormap. ocean A sequential colormap that goes from black to blue to white. ocean_r The reverse of the ocean colormap. pink A sequential colormap that goes from black to pink. pink_r The reverse of the pink colormap. plasma A sequential colormap that goes from blue to green to yellow to pink. plasma_r The reverse of the plasma colormap. prism A qualitative colormap with distinct colors. prism_r The reverse of the prism colormap. rainbow A qualitative colormap with distinct colors. rainbow_r The reverse of the rainbow colormap. seismic A diverging colormap that goes from blue to white to red. seismic_r The reverse of the seismic colormap. spring A sequential colormap that goes from magenta to yellow. spring_r The reverse of the spring colormap. summer A sequential colormap that goes from green to yellow. summer_r The reverse of the summer colormap. tab10 A qualitative colormap with 10 distinct colors. tab10_r The reverse of the tab10 colormap. tab20 A qualitative colormap with 20 distinct colors. tab20_r The reverse of the tab20 colormap. tab20b A qualitative colormap with 20 distinct colors, emphasizing the middle range. tab20b_r The reverse of the tab20b colormap. tab20c A qualitative colormap with 20 distinct colors, emphasizing the extremes. tab20c_r The reverse of the tab20c colormap. terrain A sequential colormap that goes from green to brown to gray. terrain_r The reverse of the terrain colormap. twilight A sequential colormap that goes from blue to green to yellow to orange to red. twilight_r The reverse of the twilight colormap. twilight_shifted A sequential colormap that goes from green to blue to purple to pink to orange. twilight_shifted_r The reverse of the twilight_shifted colormap. viridis A sequential colormap that goes from blue to green to yellow. viridis_r The reverse of the viridis colormap.

Accent

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Accent') pt.colorbar() pt.show()

Accent_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Accent_r') pt.colorbar() pt.show()

Blues

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Blues') pt.colorbar() pt.show()

Blues_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Blues_r') pt.colorbar() pt.show()

BrBG

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'BrBG') pt.colorbar() pt.show()

BrBG_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'BrBG_r') pt.colorbar() pt.show()

BuGn

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'BuGn') pt.colorbar() pt.show()

BuGn_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'BuGn_r') pt.colorbar() pt.show()

BuPu

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'BuPu') pt.colorbar() pt.show()

BuPu_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'BuPu_r') pt.colorbar() pt.show()

CMRmap

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'CMRmap') pt.colorbar() pt.show()

CMRmap_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'CMRmap_r') pt.colorbar() pt.show()

Dark2

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Dark2') pt.colorbar() pt.show()

Dark2_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Dark2_r') pt.colorbar() pt.show()

GnBu

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'GnBu') pt.colorbar() pt.show()

GnBu_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'GnBu_r') pt.colorbar() pt.show()

Greens

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Greens') pt.colorbar() pt.show()

Greens_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Greens_r') pt.colorbar() pt.show()

Greys

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Greys') pt.colorbar() pt.show()

Greys_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Greys_r') pt.colorbar() pt.show()

OrRd

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'OrRd') pt.colorbar() pt.show()

OrRd_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'OrRd_r') pt.colorbar() pt.show()

Oranges

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Oranges') pt.colorbar() pt.show()

Oranges_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Oranges_r') pt.colorbar() pt.show()

PRGn

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'PRGn') pt.colorbar() pt.show()

PRGn_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'PRGn_r') pt.colorbar() pt.show()

Paired

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Paired') pt.colorbar() pt.show()

Paired_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Paired_r') pt.colorbar() pt.show()

Pastel1

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Pastel1') pt.colorbar() pt.show()

Pastel1_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Pastel1_r') pt.colorbar() pt.show()

Pastel2

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Pastel2') pt.colorbar() pt.show()

Pastel2_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Pastel2_r') pt.colorbar() pt.show()

PiYG

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'PiYG') pt.colorbar() pt.show()

PiYG_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'PiYG_r') pt.colorbar() pt.show()

PuBu

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'PuBu') pt.colorbar() pt.show()

PuBu_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'PuBu_r') pt.colorbar() pt.show()

PuBuGn

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'PuBuGn') pt.colorbar() pt.show()

PuBuGn_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'PuBuGn_r') pt.colorbar() pt.show()

PuOr

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'PuOr') pt.colorbar() pt.show()

PuRd_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'PuRd_r') pt.colorbar() pt.show()

Purples

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Purples') pt.colorbar() pt.show()

Purples_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Purples_r') pt.colorbar() pt.show()

RdBu

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'RdBu') pt.colorbar() pt.show()

RdBu_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'RdBu_r') pt.colorbar() pt.show()

RdGy

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'RdGy') pt.colorbar() pt.show()

RdGy_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'RdGy_r') pt.colorbar() pt.show()

RdPu

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'RdPu') pt.colorbar() pt.show()

RdPu_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'RdPu_r') pt.colorbar() pt.show()

RdYlBu

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'RdYlBu') pt.colorbar() pt.show()

RdYlBu_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'RdYlBu_r') pt.colorbar() pt.show()

RdYlGn

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'RdYlGn') pt.colorbar() pt.show()

RdYlGn_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'RdYlGn_r') pt.colorbar() pt.show()

Reds

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Reds') pt.colorbar() pt.show()

Reds_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Reds_r') pt.colorbar() pt.show()

Set1

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Set1') pt.colorbar() pt.show()

Set1_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Set1_r') pt.colorbar() pt.show()

Set2

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Set2') pt.colorbar() pt.show()

Set2_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Set2_r') pt.colorbar() pt.show()

Set3

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Set3') pt.colorbar() pt.show()

Set3_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Set3_r') pt.colorbar() pt.show()

Spectral

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Spectral') pt.colorbar() pt.show()

Spectral_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Spectral_r') pt.colorbar() pt.show()

Wistia

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Wistia') pt.colorbar() pt.show()

Wistia_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Wistia_r') pt.colorbar() pt.show()

YlGn

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'YlGn') pt.colorbar() pt.show()

YlGn_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'YlGn_r') pt.colorbar() pt.show()

YlGnBu

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'YlGnBu') pt.colorbar() pt.show()

YlGnBu_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'YlGnBu_r') pt.colorbar() pt.show()

YlOrBr

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'YlOrBr') pt.colorbar() pt.show()

YlOrBr_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'YlOrBr_r') pt.colorbar() pt.show()

YlOrRd

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'YlOrRd') pt.colorbar() pt.show()

YlOrRd_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'YlOrRd_r') pt.colorbar() pt.show()

afmhot

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'afmhot') pt.colorbar() pt.show()

afmhot_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'afmhot_r') pt.colorbar() pt.show()

Autumn

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'autumn') pt.colorbar() pt.show()

Autumn_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'autumn_r') pt.colorbar() pt.show()

Binary

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'binary') pt.colorbar() pt.show()

Binary_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'binary_r') pt.colorbar() pt.show()

Bone

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'bone') pt.colorbar() pt.show()

Bone_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'bone_r') pt.colorbar() pt.show()

Brg

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'brg') pt.colorbar() pt.show()

Brg_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'brg_r') pt.colorbar() pt.show()

Bwr

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'bwr') pt.colorbar() pt.show()

Bwr_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'bwr_r') pt.colorbar() pt.show()

Cividis

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'cividis') pt.colorbar() pt.show()

Cividis_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'cividis_r') pt.colorbar() pt.show()

Cool

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'cool') pt.colorbar() pt.show()

Cool_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'cool_r') pt.colorbar() pt.show()

Coolwarm

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'coolwarm') pt.colorbar() pt.show()

Coolwarm_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'coolwarm_r') pt.colorbar() pt.show()

Copper

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'copper') pt.colorbar() pt.show()

Copper_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'copper_r') pt.colorbar() pt.show()

Cubehelix

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'cubehelix') pt.colorbar() pt.show()

Cubehelix_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'cubehelix_r') pt.colorbar() pt.show()

Flag

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'flag') pt.colorbar() pt.show()

Flag_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'flag_r') pt.colorbar() pt.show()

Gist_earth

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_earth') pt.colorbar() pt.show()

Gist_earth_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_earth_r') pt.colorbar() pt.show()

Gist_gray

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_gray') pt.colorbar() pt.show()

Gist_gray_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_gray_r') pt.colorbar() pt.show()

Gist_heat

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_heat') pt.colorbar() pt.show()

Gist_heat_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_heat_r') pt.colorbar() pt.show()

Gist_ncar

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_ncar') pt.colorbar() pt.show()

Gist_ncar_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_ncar_r') pt.colorbar() pt.show()

Gist_rainbow

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_rainbow') pt.colorbar() pt.show()

Gist_rainbow_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_rainbow_r') pt.colorbar() pt.show()

Gist_stern

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_stern') pt.colorbar() pt.show()

Gist_stern_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_stern_r') pt.colorbar() pt.show()

Gist_yarg

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_yarg') pt.colorbar() pt.show()

Gist_yarg_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gist_yarg_r') pt.colorbar() pt.show()

Gnuplot

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gnuplot') pt.colorbar() pt.show()

Gnuplot_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gnuplot_r') pt.colorbar() pt.show()

Gnuplot2

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gnuplot2') pt.colorbar() pt.show()

Gnuplot2_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gnuplot2_r') pt.colorbar() pt.show()

Gray

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gray') pt.colorbar() pt.show()

Gray_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'gray_r') pt.colorbar() pt.show()

Hot

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'hot') pt.colorbar() pt.show()

Hot_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'hot_r') pt.colorbar() pt.show()

Hsv

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'hsv') pt.colorbar() pt.show()

Hsv_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'hsv_r') pt.colorbar() pt.show()

Inferno

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'inferno') pt.colorbar() pt.show()

Inferno_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'inferno_r') pt.colorbar() pt.show()

Jet

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'jet') pt.colorbar() pt.show()

Jet_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'jet_r') pt.colorbar() pt.show()

Magma

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'magma') pt.colorbar() pt.show()

Magma_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'magma_r') pt.colorbar() pt.show()

Nipy_spectral

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'nipy_spectral') pt.colorbar() pt.show()

Nipy_spectral_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'Accent_r') pt.colorbar() pt.show()

Ocean

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'ocean') pt.colorbar() pt.show()

Ocean_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'ocean_r') pt.colorbar() pt.show()

Pink

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'pink') pt.colorbar() pt.show()

Pink_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'pink_r') pt.colorbar() pt.show()

Plasma

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'plasma') pt.colorbar() pt.show()

Plasma_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'plasma_r') pt.colorbar() pt.show()

Prism

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'prism') pt.colorbar() pt.show()

Prism_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'prism_r') pt.colorbar() pt.show()

Rainbow

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'rainbow') pt.colorbar() pt.show()

Rainbow_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'rainbow_r') pt.colorbar() pt.show()

Seismic

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'seismic') pt.colorbar() pt.show()

Seismic_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'seismic_r') pt.colorbar() pt.show()

Spring

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'spring') pt.colorbar() pt.show()

Spring_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'spring_r') pt.colorbar() pt.show()

Summer

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'summer') pt.colorbar() pt.show()

Summer_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'summer_r') pt.colorbar() pt.show()

Tab10

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'tab10') pt.colorbar() pt.show()

Tab10_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'tab10_r') pt.colorbar() pt.show()

Tab20

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'tab20') pt.colorbar() pt.show()

Tab20_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'tab20_r') pt.colorbar() pt.show()

Tab20b

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'tab20b') pt.colorbar() pt.show()

Tab20b_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'tab20b_r') pt.colorbar() pt.show()

Tab20c

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'tab20c') pt.colorbar() pt.show()

Tab20c_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'tab20c_r') pt.colorbar() pt.show()

Terrain

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'terrain') pt.colorbar() pt.show()

Terrain_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'terrain_r') pt.colorbar() pt.show()

Twilight

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'twilight') pt.colorbar() pt.show()

Twilight_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'twilight_r') pt.colorbar() pt.show()

Twilight_shifted

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'twilight_shifted') pt.colorbar() pt.show()

Twilight_shifted_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'twilight_shifted_r') pt.colorbar() pt.show()

Viridis

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'viridis') pt.colorbar() pt.show()

Viridis_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'viridis_r') pt.colorbar() pt.show()

Winter

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'winter') pt.colorbar() pt.show()

Winter_r

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) pt.scatter(random_num, prime, c = mrx_colors, cmap = 'winter_r') pt.colorbar() pt.show()

Size

With Matplotlib scatter, you can customize the size of the points with the s argument.

Similarly to colors, ensure that the arrays for x and y axis are the identical size:

According to your need customize the size of the following markers:

Example:

import matplotlib.pyplot as pt import numpy as npy random_fibionacci = npy.array([13, 5, 2, 8, 21, 34, 3, 1]) random_num = npy.array([10,87,54,33,47,21,13, 5]) mrx_colors = npy.array([0,15,38,62,25,54,73,86]) mrx_sizes = npy.array([90,150,230,33,410,550,320,170]) pt.scatter(random_fibionacci, random_num, c = mrx_colors, s = mrx_sizes, cmap = 'cividis') pt.colorbar() pt.show()

First assign different sizes to markers and also insert the ‘inferno’ color map:

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) mrx_sizes = npy.array([800,650,270,190,360,580,80,120,444,55,710,410,230]) pt.scatter(random_num, prime, c = mrx_colors, s = mrx_sizes, cmap = 'inferno') pt.colorbar() pt.show()

Alpha

With Matplotlib scatter, you can modify the transparency of the points by changing the alpha parameter values.

Similarly to colors, ensure that the array for dimensions has the identical length as the arrays for the x- and y-axis:

Modify the opacity of the markers:

Example:

import matplotlib.pyplot as pt import numpy as npy random_fibionacci = npy.array([13, 5, 2, 8, 21, 34, 3, 1]) random_num = npy.array([10,87,54,33,47,21,13, 5]) mrx_colors = npy.array([0,15,38,62,25,54,73,86]) mrx_sizes = npy.array([90,150,230,33,410,550,320,170]) pt.scatter(random_fibionacci, random_num, c = mrx_colors, s = mrx_sizes, cmap = 'nipy_spectral', apha = 0.8) pt.colorbar() pt.show()

Utilize the ‘ocean’ colormap and change the opacity of the points:

Example:

import matplotlib.pyplot as pt import numpy as npy random_num = npy.array([5,39,16,7,41,9,35,51,3,61,2,24,1]) prime = npy.array([31, 37, 19, 43, 47, 53, 23, 62, 29, 41, 16, 59, 17]) mrx_colors = npy.array([20,73,51,13,82,69,29,33,71,44,5,49,99]) mrx_sizes = npy.array([800,650,270,190,360,580,80,120,444,55,710,410,230]) pt.scatter(random_num, prime, c = mrx_colors, s = mrx_sizes, cmap = 'ocean', alpha = 0.3) pt.colorbar() pt.show()

Combine Color Size and Alpha

Utilizing 100 x-points, y-points, colors, and sizes, generate random arrays:

Example:

import matplotlib.pyplot as pt import numpy as npy mrx = npy.random.randint(100, size=(50)) ample = npy.random.randint(100, size=(50)) mrx_colors = npy.random.randint(100, size=(50)) mrx_sizes = 30 * npy.random.randint(100, size=(50)) pt.scatter(mrx, ample, c=mrx_colors, s=mrx_sizes, alpha=0.7, cmap='terrain') pt.colorbar() pt.show()

Apply size = 200 in the below four arrays and also utilize the gist_ncar colormap:

Example:

import matplotlib.pyplot as pt import numpy as npy mrx =npy.random.randint(300, size=(200)) ample = npy.random.randint(300, size=(200)) mrx_colors = npy.random.randint(100, size=(200)) mrx_sizes = 10 * npy.random.randint(100, size=(200)) pt.scatter(mrx, ample, c=mrx_colors, s=mrx_sizes, alpha=0.9, cmap='gist_ncar') pt.colorbar() pt.show()

Example Explanation

The above example utilizes Matplotlib library to create a scatter plot. The code can be summarized as follows:

• Matplotlib library is imported with an alias “pt“.
• A NumPy array “mrx” is generated containing 200 random integers from 0 to 299.
• Another NumPy arrayample” is generated containing 200 random integers from 0 to 299.
• A third NumPy array “mrx_colors” is generated containing 200 random integers from 0 to 99 which will be used to determine colors for the scatter plot points.
• A fourth NumPy array “mrx_sizes” is generated containing 200 random integers from 0 to 999 which will be used to determine the size of the scatter plot points.
• The “scatterfunction from Matplotlib is used to create a scatter plot. The function takes several parameters including x and y coordinates of the points, the color map to be used, the size of each point, and the transparency of each point.
• A color bar is added to the plot using the “colorbar” function.
• The plot is displayed using the “show” function.

Matplotlib Scatter Benefits

Scatter plots have the following benefits:

1. Matplotlib scatter plots are great for displaying how two variables are related to each other, which helps to identify patterns or trends in data.
2. Matplotlib scatter plots can be customized in many ways, such as changing the color, shape, size, and transparency of points. This provides a more informative and visually appealing visualization.
3. Matplotlib scatter plots can be used to visualize the distribution of data points, especially when there are a large number of points. This is useful in detecting any outliers or patterns in the data.
4. Creating scatter plots with Matplotlib in Python is relatively simple, making it a popular choice for data visualization. It is also a well-known library with ample resources for learning and troubleshooting.
5. Matplotlib scatter plots can be made interactive by using other libraries such as Plotly, Bokeh or mpld3, allowing users to zoom in, hover over data points, and access additional information.
6. Matplotlib scatter plots can be easily shared and displayed on different operating systems and devices, as Matplotlib is a cross-platform library.

Conclusion

Matplotlib scatter plots offer a flexible and adaptable approach for displaying the correlation between two variables and the distribution of data points. Due to its simplicity, cross-platform adaptability, and capacity for interactivity, Matplotlib has become a widely-used data visualization tool in Python. Whether you are new to the field or an experienced data analyst, acquiring expertise in creating scatter plots using Matplotlib is a valuable asset for your toolkit.

+1
0
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0