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 MapsOverview
AccentA qualitative colormap with bright colors.
Accent_rThe reverse of the Accent colormap.
BluesA sequential colormap that goes from light to dark blue.
Blues_rThe reverse of the Blues colormap.
BrBGA diverging colormap that goes from brown to green to blue.
BrBG_rThe reverse of the BrBG colormap.
BuGnA sequential colormap that goes from light blue to dark green.
BuGn_rThe reverse of the BuGn colormap.
BuPuA sequential colormap that goes from light blue to dark purple.
BuPu_rThe reverse of the BuPu colormap.
CMRmapA colormap that goes from black to red to yellow to white.
CMRmap_rThe reverse of the CMRmap colormap.
Dark2A qualitative colormap with dark colors.
Dark2_rThe reverse of the Dark2 colormap.
GnBuA sequential colormap that goes from green to blue.
GnBu_rThe reverse of the GnBu colormap.
GreensA sequential colormap that goes from light to dark green.
Greens_rThe reverse of the Greens colormap.
GreysA sequential colormap that goes from black to white.
Greys_rThe reverse of the Greys colormap.
OrRdA sequential colormap that goes from orange to red.
OrRd_rThe reverse of the OrRd colormap.
OrangesA sequential colormap that goes from light orange to dark orange.
Oranges_rThe reverse of the Oranges colormap.
PRGnA diverging colormap that goes from purple to green.
PRGn_rThe reverse of the PRGn colormap.
PairedA qualitative colormap with paired colors.
Paired_rThe reverse of the Paired colormap.
Pastel1A qualitative colormap with pastel colors.
Pastel1_rThe reverse of the Pastel1 colormap.
Pastel2A qualitative colormap with pastel colors.
Pastel2_rThe reverse of the Pastel2 colormap.
PiYGA diverging colormap that goes from pink to green.
PiYG_rThe reverse of the PiYG colormap.
PuBuA sequential colormap that goes from purple to blue.
PuBuGnA sequential colormap that goes from purple to blue to green.
PuBuGn_rThe reverse of the PuBuGn colormap.
PuBu_rThe reverse of the PuBu colormap.
PuOrA diverging colormap that goes from purple to orange.
PuOr_rThe reverse of the PuOr colormap.
PuRdA sequential colormap that goes from purple to red.
PuRd_rThe reverse of the PuRd colormap.
PurplesA sequential colormap that goes from light to dark purple.
Purples_rThe reverse of the Purples colormap.
RdBuA diverging colormap that goes from red to blue.
RdBu_rThe reverse of the RdBu colormap.
RdGyA diverging colormap that goes from red to white to blue.
RdGy_rThe reverse of the RdGy colormap.
RdPuA sequential colormap that goes from red to purple.
RdPu_rThe reverse of the RdPu colormap.
RdYlBuA diverging colormap that goes from red to yellow to blue.
RdYlBu_rThe reverse of the RdYlBu colormap.
RdYlGnA diverging colormap that goes from red to yellow to green.
RdYlGn_rThe reverse of the RdYlGn colormap.
RedsA sequential colormap that goes from light to dark red.
Reds_rThe reverse of the Reds colormap.
Set1A qualitative colormap with distinct colors.
Set1_rThe reverse of the Set1 colormap.
Set2A qualitative colormap with distinct colors.
Set2_rThe reverse of the Set2 colormap.
Set3A qualitative colormap with distinct colors.
Set3_rThe reverse of the Set3 colormap.
SpectralA diverging colormap that goes from red to yellow to green to blue.
Spectral_rThe reverse of the Spectral colormap.
WistiaA sequential colormap that goes from light yellow to dark yellow.
Wistia_rThe reverse of the Wistia colormap.
YlGnA sequential colormap that goes from light yellow to dark green.
YlGnBuA sequential colormap that goes from light yellow to blue to dark green.
YlGnBu_rThe reverse of the YlGnBu colormap.
YlGn_rThe reverse of the YlGn colormap.
YlOrBrA sequential colormap that goes from light yellow to dark brown.
YlOrBr_rThe reverse of the YlOrBr colormap.
YlOrRdA sequential colormap that goes from light yellow to dark red.
YlOrRd_rThe reverse of the YlOrRd colormap.
afmhotA sequential colormap that goes from black to red to yellow to white.
afmhot_rThe reverse of the afmhot colormap.
autumnA sequential colormap that goes from red to yellow to brown.
autumn_rThe reverse of the autumn colormap.
binaryA colormap that goes from black to white.
binary_rThe reverse of the binary colormap.
boneA sequential colormap that goes from black to white with a blue tint.
bone_rThe reverse of the bone colormap.
brgA colormap that goes from blue to red to green.
brg_rThe reverse of the brg colormap.
bwrA diverging colormap that goes from blue to white to red.
bwr_rThe reverse of the bwr colormap.
cividisA sequential colormap that goes from blue to yellow to green.
cividis_rThe reverse of the cividis colormap.
coolA sequential colormap that goes from cyan to magenta.
cool_rThe reverse of the cool colormap.
coolwarmA diverging colormap that goes from blue to white to red.
coolwarm_rThe reverse of the coolwarm colormap.
copperA sequential colormap that goes from black to brown.
copper_rThe reverse of the copper colormap.
cubehelixA sequential colormap that goes from black to red to yellow to white.
cubehelix_rThe reverse of the cubeh.
flagA colormap that goes from red to white to blue.
flag_rThe reverse of the flag colormap.
gist_earthA sequential colormap that goes from brown to green to blue.
gist_earth_rThe reverse of the gist_earth colormap.
gist_grayA sequential colormap that goes from black to white.
gist_gray_rThe reverse of the gist_gray colormap.
gist_heatA sequential colormap that goes from black to yellow to red.
gist_heat_rThe reverse of the gist_heat colormap.
gist_ncarA qualitative colormap with distinct colors.
gist_ncar_rThe reverse of the gist_ncar colormap.
gist_rainbowA qualitative colormap with distinct colors.
gist_rainbow_rThe reverse of the gist_rainbow colormap.
gist_sternA sequential colormap that goes from blue to white to red.
gist_stern_rThe reverse of the gist_stern colormap.
gist_yargA sequential colormap that goes from black to white with a blue tint.
gist_yarg_rThe reverse of the gist_yarg colormap.
gnuplotA sequential colormap that goes from yellow to red to purple.
gnuplot2A sequential colormap that goes from blue to green to yellow to red to purple.
gnuplot2_rThe reverse of the gnuplot2 colormap.
gnuplot_rThe reverse of the gnuplot colormap.
grayA sequential colormap that goes from black to white.
gray_rThe reverse of the gray colormap.
hotA sequential colormap that goes from black to red to yellow to white.
hot_rThe reverse of the hot colormap.
hsvA colormap that goes from red to yellow to green to blue to purple to red.
hsv_rThe reverse of the hsv colormap.
infernoA sequential colormap that goes from black to yellow to red to purple.
inferno_rThe reverse of the inferno colormap.
jetA colormap that goes from blue to green to yellow to red.
jet_rThe reverse of the jet colormap.
magmaA sequential colormap that goes from black to purple to pink to yellow.
magma_rThe reverse of the magma colormap.
nipy_spectralA diverging colormap that goes from blue to white to red to yellow to green.
nipy_spectral_rThe reverse of the nipy_spectral colormap.
oceanA sequential colormap that goes from black to blue to white.
ocean_rThe reverse of the ocean colormap.
pinkA sequential colormap that goes from black to pink.
pink_rThe reverse of the pink colormap.
plasmaA sequential colormap that goes from blue to green to yellow to pink.
plasma_rThe reverse of the plasma colormap.
prismA qualitative colormap with distinct colors.
prism_rThe reverse of the prism colormap.
rainbowA qualitative colormap with distinct colors.
rainbow_rThe reverse of the rainbow colormap.
seismicA diverging colormap that goes from blue to white to red.
seismic_rThe reverse of the seismic colormap.
springA sequential colormap that goes from magenta to yellow.
spring_rThe reverse of the spring colormap.
summerA sequential colormap that goes from green to yellow.
summer_rThe reverse of the summer colormap.
tab10A qualitative colormap with 10 distinct colors.
tab10_rThe reverse of the tab10 colormap.
tab20A qualitative colormap with 20 distinct colors.
tab20_rThe reverse of the tab20 colormap.
tab20bA qualitative colormap with 20 distinct colors, emphasizing the middle range.
tab20b_rThe reverse of the tab20b colormap.
tab20cA qualitative colormap with 20 distinct colors, emphasizing the extremes.
tab20c_rThe reverse of the tab20c colormap.
terrainA sequential colormap that goes from green to brown to gray.
terrain_rThe reverse of the terrain colormap.
twilightA sequential colormap that goes from blue to green to yellow to orange to red.
twilight_rThe reverse of the twilight colormap.
twilight_shiftedA sequential colormap that goes from green to blue to purple to pink to orange.
twilight_shifted_rThe reverse of the twilight_shifted colormap.
viridisA sequential colormap that goes from blue to green to yellow.
viridis_rThe 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.

We value your feedback.
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Subscribe To Our Newsletter
Enter your email to receive a weekly round-up of our best posts. Learn more!
icon

Leave a Reply

Your email address will not be published. Required fields are marked *