Electron microscopy
 
Commands/concepts of plot with matplotlib.pyplot 
- Integrated Circuits -
- An Online Book -
Integrated Circuits                                                                                   http://www.globalsino.com/ICs/        


Chapter/Index: Introduction | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | Appendix

=================================================================================

Table 4500. Characters for markers and colors.

Character and description Character and color
'-' solid line style
'--' dashed line style
'-.' dash-dot line style
':' dotted line style
'.' point marker
',' pixel marker
'o' circle marker
'v' triangle_down marker
'^' triangle_up marker
'<' triangle_left marker
'>' triangle_right marker
'1' tri_down marker
'2' tri_up marker
'3' tri_left marker
'4' tri_right marker
's' square marker
'p' pentagon marker
'*' star marker
'h' hexagon1 marker
'H' hexagon2 marker
'+' plus marker
'x' x marker
'D' diamond marker
'd' thin_diamond marker
'|' vline marker
'_' hline marker
‘b’ blue
‘g’ green
‘r’ red
‘c’ cyan
‘m’ magenta
‘y’ yellow
‘k’ black
‘w’ white

 Figure 4500a. Components of a Matplotlib figure. [1]

Others:

============================================

Annotate Matplotlib Chart:
               import matplotlib.patches as patches
          A. plt.add_patch or ax1.add_patch( patches.Rectangle( (15, 35), # (x,y)
               40, # width
               60, # height
               # Rotation as well with 'angle'
               alpha=0.3, facecolor="red", edgecolor="black", linewidth=3, linestyle='solid'))
          B. ax1.add_patch(patches.Circle((30, 55), # (x,y)
              430, # radius
              alpha=0.4, facecolor="green", edgecolor="black", linewidth=1, linestyle='solid'))
          C. ax1.add_patch(patches.Ellipse((50, 65), # (x,y)
              50, # width
              80, # height
              545, # radius
              alpha=0.4, facecolor="green", edgecolor="black", linewidth=1, linestyle='solid'))
          D. Segment annotation:
               plt.plot([60, 30], [25, 80], color="skyblue", lw=5, linestyle='solid', label="_not in legend")
          E. Vertical and Horizontal Lines:
               plt.axvline(50, color='r')
               plt.axhline(60, color='green')
          F.
               plt.text(20, 0.5, 'Text') # Coordinates and text
               plt.text(0.5, 0.5, 'Center', transform = ax.transAxes)
               plt.text(0.05, 0.05, 'Bottom-left', transform = ax.transAxes)
               plt.text(0.8, 0.85, 'Top-right', transform = ax.transAxes)
               plt.text(0.8, 0.05, 'Bottom-right', transform = ax.transAxes)
               plt.text(0.05, 0.85, 'Top-left', transform = ax.transAxes)
               plt.text(10, 0.5, 'Text', color = "green")
               plt.text(10, 0.5, 'Text', fontsize = 16)
               plt.text(10, 0.5, 'Text', verticalalignment = 'bottom', horizontalalignment = 'right')
               plt.text(10, 0.5, 'Text', rotation = 45)
               plt.text(10, 0.5, 'Text', bbox = {'facecolor': 'oldlace', 'alpha': 0.5, 'pad': 8})
               plt.text(10, 0.5, 'Text inside box', bbox = {'facecolor': 'oldlace', 'alpha': 0.5, 'boxstyle': "rarrow,pad=0.3", 'ec': 'red'})
               plt.annotate('', xy = (13, -0.8), xytext = (13, 0.15), arrowprops = dict(facecolor = 'red', width = 0.4, headwidth = 8))

============================================

Pass multiple lists to plot a function with numpy and matplotlib.pyplot: code:
          Find the best similarity with Word2Vec Models/word embeddings
Output (the text is shown at the x- and y-coordinates in the code above):         
         Find the best similarity with Word2Vec Models/word embeddings

============================================

Plot with ordered dates and texts is shown in the image: code:
          Find the best similarity with Word2Vec Models/word embeddings
Output:         
         Find the best similarity with Word2Vec Models/word embeddings
         Find the best similarity with Word2Vec Models/word embeddings
         Find the best similarity with Word2Vec Models/word embeddings

============================================

Plot data from multiple sets of data in a csv files: code:
          Find the best similarity with Word2Vec Models/word embeddings
Input:         
          Find the best similarity with Word2Vec Models/word embeddings
Output:         
          Find the best similarity with Word2Vec Models/word embeddings

============================================

Plot images from data, with names, with pie in a csv files: code:
          Find the best similarity with Word2Vec Models/word embeddings
Input:         
          Find the best similarity with Word2Vec Models/word embeddings
Output:         
          Find the best similarity with Word2Vec Models/word embeddings

============================================

Pie with specific colors: code:
          Find the best similarity with Word2Vec Models/word embeddings
Input:         
         Find the best similarity with Word2Vec Models/word embeddings
Output:         
          Find the best similarity with Word2Vec Models/word embeddings

============================================

Plot images from data, with names, with scatter in a csv files: code:
          Find the best similarity with Word2Vec Models/word embeddings
Input:         
          Find the best similarity with Word2Vec Models/word embeddings
Output:         
          Find the best similarity with Word2Vec Models/word embeddings

============================================

Plot images from data, with names, in a csv files: code:
          Find the best similarity with Word2Vec Models/word embeddings
Input:         
          Find the best similarity with Word2Vec Models/word embeddings
Output:         
          Find the best similarity with Word2Vec Models/word embeddings

======================

Plot images from data, with names, in a csv files (see details at page4806): code:
          Find the best similarity with Word2Vec Models/word embeddings
          With the same code above, but there is an error showing if the csv file has only two columns as shown below:
          <_csv.reader object at 0x000001A5BCA70640>
          ['Mike', '41']

          Traceback (most recent call last):
          File "C:\GlobalSino2\ICs\page4853WithoutAxis.py", line 21, in <module>
          y.append(int(float(row[2])))
          IndexError: list index out of range

Input:         
          Find the best similarity with Word2Vec Models/word embeddings                   

============================================

The "X" samples and "Y" samples are clustered on the left and right sides, suggesting that they are correlated with each other in each group. The separation of the two clusters along the x-axis suggests that "X" samples are very different from "Y" samples. The loading scores for PC1 to determine which N had the largest influence on the separating the two clusters along the x-axis.
Apply training data to PCA: code:    
          Find the best similarity with Word2Vec Models/word embeddings
          Find the best similarity with Word2Vec Models/word embeddings
Output:         
         Find the best similarity with Word2Vec Models/word embeddings
         Find the best similarity with Word2Vec Models/word embeddings

============================================

Plot pixel intensities along a line of an image: code:
         continue in Python
Input:         
         continue in Python
Output:         
         continue in Python

============================================


============================================
Plot can be blurry if the setting is not correct, for instance below.          
Code:         
         Find the best similarity with Word2Vec Models/word embeddings
Output:         
         Find the best similarity with Word2Vec Models/word embeddings
Code:         
         Find the best similarity with Word2Vec Models/word embeddings
Output:         
         Find the best similarity with Word2Vec Models/word embeddings
Code:         
         Find the best similarity with Word2Vec Models/word embeddings
Output:         
         Find the best similarity with Word2Vec Models/word embeddings
Code:         
         Find the best similarity with Word2Vec Models/word embeddings
Output:         
         Add a new slide on ppt

==============================================

Plot date related data in the re-ordered dates with annotation: code:
          Find the best similarity with Word2Vec Models/word embeddings
Output:         
         Find the best similarity with Word2Vec Models/word embeddings
         Find the best similarity with Word2Vec Models/word embeddings

==============================================

Plot date related data in the re-ordered dates with annotation: code:
          Find the best similarity with Word2Vec Models/word embeddings
Output:         
         Find the best similarity with Word2Vec Models/word embeddings
         Find the best similarity with Word2Vec Models/word embeddings

==============================================

Plot image with annotation in re-ordered dates: code:
          Find the best similarity with Word2Vec Models/word embeddings
          Find the best similarity with Word2Vec Models/word embeddings
Output:         
         Find the best similarity with Word2Vec Models/word embeddings
         Find the best similarity with Word2Vec Models/word embeddings

==============================================

         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         

 

 

 

 

 

 

 

 

[1] https://matplotlib.org. 

 

=================================================================================