A comprehensive tutorial for plotting focal mechanism

Overview

Focal_Mechanisms_Demo

A comprehensive tutorial for plotting focal mechanism "beach-balls" using the PyGMT package for Python.

(Resulting map of this demo)

Background

To better understand the faulting motions that create earthquakes, it can be useful to graphically display focal mechanisms. A focal mechanism is the orientation and type of slip of a fault, and it is represented as a “beach-ball” symbol.

(Image is sourced from the United States Geological Survey earthquake hazards webpage on focal mechanisms)

Within a “beach-ball,” the dark quarters represent compressional forces and the white quarters represent tensional forces. A “beach-ball” has two possible orientations of fault movement, each along with one of the planes dividing the “beach-ball” into fourths, and determining the correct orientation requires additional information. When “beach-balls” present four equally sized quadrants in a “top-down” view like the one in the above diagram, strike-slip faulting is represented. Rotated “beach-balls” with a white quarter in the center represent normal faulting, while “beach-balls” with a dark quarter in the center represent thrust faulting.

The Demonstration

In this demo, focal mechanism data will be retrieved from the Southern California Earthquake Data Center (SCEDC) and then plotted as focal mechanism “beach-balls” on a map with the geospatial Python package PyGMT.

Please keep in mind that with the exception of the folder creation script, all code blocks shown in this demo are intended to be run as part of a complete script, which is included at the bottom of the page.

Getting Started

Create Project Folders

To follow this demo as written, project folders need to be created on the Desktop. A diagram of the desired directory tree for Windows 10 is shown below:

(Image created with Lucidchart)

These folders can be created either by running the script provided below from anywhere after changing the main_dir file path to reflect your username or by manually creating a Focal_Mechanism_Demo folder and within it Data, Methods, and Results folders.

'''
Decription:
This script creates folders for the focal_mechanism_demo.py script if they don't already exist
'''

import os

# main directory path
main_dir = r'C:\Users\USER\Desktop\Focal_Mechanism_Demo'

# path to the directory holding the project data files
data_folder = os.path.join(main_dir, 'Data')

# path to the directory holding the project Python scripts
methods_folder = os.path.join(main_dir, 'Methods')

# path to the directory holding the map generated by the scripts
results_folder = os.path.join(main_dir, 'Results')

directories = [main_dir, data_folder, methods_folder, results_folder]

# Iterates through the list of directories and creates them if they don't already exist
for directory in directories:
    os.makedirs(directory, exist_ok = True)

Data files used and created by the demo script will be located in the Data folder, and the focal mechanism map will save to the Results folder. The Methods folder should contain the demo scripts.

Retrieve Focal Mechanism Data

Focal mechanism data will be acquired by downloading it from the SCEDC focal mechanism catalog. This demo uses the following search parameters:

Date range: 2019/01/01 to 2020/01/01

Magnitude range: 5 to 10

Latitude range: 35.5 to 36.1

Longitude range: -118 to -117.15

Depth range: -5 to 100

(Example of entering the focal mechanism parameters into the SCEDC focal mechanism catalog search)

After clicking the search button, the results are presented as a text page. Select the data and column headers as shown below, and copy them into a text file. Then save the text file to the Data folder and name it focal_mechanism_data.

(Example of selecting and copying the focal mechanism data and column headers)

Creating The Project Files

Conditioning The Focal Mechanism Data

The focal mechanism data as retrieved from the SCEDC does not have a uniform delimiter separating the columns and has an empty line between the column header and the column values. In order to read the data into a data frame, it needs to be conditioned so that the aforementioned issues are resolved.

The following demo script function removes the empty line and standardizes the delimiter to be tabs, then saves the conditioned data as a CSV file:

    # Conditions focal mechanism files downloaded from the Southern California Earthquake Data Center so that they can be used
    def Condition_Focal_Mechanism_Data(self):
        import os
        import re

        print('Conditioning focal mechanisms...')


        input_file = os.path.join(self.main_dir, 'Data', 'focal_mechanism_data.txt')
        # reads in the file by line rather than the default of by character
        with open(input_file, 'r') as f:
            lines = f.readlines()

        # holds the conditioned lines, namely the removal of empty lines
        conditioned_lines = []
        # iterates over each line and adds them to a list as long as they are not empty
        for line in lines:
            if line == '\n':
                continue
            conditioned_lines.append(line)
        
        # empty placeholder for the conditioned lines list to be rejoined into a string
        conditioned_data = ''
        # rejoins the conditioned lines into a string so that it can be further conditioned
        conditioned_data = conditioned_data.join(conditioned_lines)

        # regular expression pattern for finding 1 or more white spaces (key) and the replacment value for matches (value)
        replacements = {' +':'\t'}
        # subsitutes text using the patterns in "replacements"
        for key, value in replacements.items():
            data = re.sub(key, value, conditioned_data)

        output_file = os.path.join(self.main_dir, 'Data', 'focal_mechanism_data.csv')
        with open(output_file, 'w') as f:
            f.write(data)

Filtering Focal Mechanism Data Into The “Aki” Format

After conditioning the focal mechanism data, it needs to be filtered so that the resulting file can be read by the PyGMT meca function, which plots focal mechanism “beach-balls.” As the data provided by the SCEDC is in terms of strike, drip, rake, and magnitude, the focal mechanism “beach-balls” will be determined by way of the Aki and Richards (1980) convention. In this demo, earthquakes greater than or equal to M7.0 will be offset to showcase how offsetting is accomplished. The meca function requires a file to be passed directly to the spec parameter when offsetting, so a CSV file with specific columns and column order pertaining to the convention needs to be created. Additionally, the column headers must be removed, so that header names don’t plot as text.

The following demo script function splits the focal mechanism data into two data frames at M7.0 earthquakes, then converts the magnitudes so that they are exponentially scaled; this is how the “beach-balls” will be sized when they are plotted. Next, it adds offset coordinates and text label columns to the data frame of M7.0 and greater earthquakes so they will be offset from their point of origin when plotted. Finally, the two data frames are saved as CSV files:

< magnitude_filter)] # focal mechanisms with earthquake magnitude greater than or equal to the magnitude filter df_offset_mag_filtered_focal_mecha =df_focal_mechanisms[(df_focal_mechanisms.MAG >= magnitude_filter)] # reads the unmodifed magnitude of the focal mechanisms that will be offset into a list so it can be later used to label them fm_label = [] for i in df_offset_mag_filtered_focal_mecha.MAG: fm_label.append(i) fm_dataframes = [df_mag_filtered_focal_mecha, df_offset_mag_filtered_focal_mecha] # iterates through each focal mechanism dataframe and scales them expoentially so that they will be plotted as exponentially larger sizes, and resets the index in place while not including the old index as a column which is done for tidyness for dataframe in fm_dataframes: dataframe.reset_index(inplace=True, drop=True) dataframe['MAG'] = 0.1 * (2 ** dataframe.MAG) # new dataframes to hold only the columns used for the "aki" focal mechanism format fm_aki_format = pd.DataFrame() fm_aki_format_offset = pd.DataFrame() aki_dataframes = [fm_aki_format, fm_aki_format_offset] # column names of the aki format, with keys being columns from the focal mechanism dataframes and values being the new column names to be used aki_format_attributes = {'LON':'longitude', 'LAT':'latitude', 'DEPTH':'depth', 'STRIKE':'strike', 'DIP':'dip', 'RAKE':'rake', 'MAG':'magnitude'} # add the desired columns for the 'aki' focal mechanism format to the new dataframes in the desired order for aki_data, fm_data in zip(aki_dataframes, fm_dataframes): for key, value in aki_format_attributes.items(): aki_data[value] = fm_data[key] # offset coordinates (lon:lat) used for offsetting the selected focal mechanisms offset_coordinates = {-117.70:35.78} fm_aki_format_offset['offset_longitude'] = offset_coordinates.keys() fm_aki_format_offset['offset_latitude'] = offset_coordinates.values() # adds label data for plotting above each focal mechanism beachball fm_aki_format_offset['label_mag'] = fm_label # path to the "small" EQ focal mechanisms focal_mechanisms_lesser_output = os.path.join(self.main_dir, 'Data', 'focal_mechanism_data_less_than_M{}.csv').format(magnitude_filter) # path to the "large" EQ focal mechanisms focal_mechanisms_greater_output = os.path.join(self.main_dir, 'Data', 'focal_mechanism_data_greater_than_or_equal_to_M{}.csv').format(magnitude_filter) focal_mechanism_outputs = [focal_mechanisms_lesser_output, focal_mechanisms_greater_output] # writes the aki format dataframes to csv files, leaving out the header. This is important because if the header is included, fig.meca will plot the header text for dataframe, path in zip(aki_dataframes, focal_mechanism_outputs): dataframe.to_csv(path, sep='\t', index=False, header=None) return fm_depths, fm_mags, magnitude_filter ">
    # Creates a focal mechanism dataframe in the "aki" format from the focal mechanism data
    def Filter_AKI_Format_Focal_Mechanism_Data(self):
        import os
        import pandas as pd

        print('Writing focal mechanisms to CSV...')


        focal_mechanisms =  os.path.join(self.main_dir, 'Data', 'focal_mechanism_data.csv')
        df_focal_mechanisms = pd.read_csv(focal_mechanisms , sep='\t')
        
        # saves the unified depth column as a pandas series so that it can be recalled later for coloring the focal mechanisms by depth
        fm_depths = df_focal_mechanisms['DEPTH']
        # saves the unified depth magnitude column as a pandas series so that it can be recalled later for creating the legend
        fm_mags = df_focal_mechanisms['MAG']

        # magnitude of earthquakes used to filter out the focal mechanisms that will be offset
        magnitude_filter = 7

        # focal mechanisms with earthquake magnitude less than the magnitude filter
        df_mag_filtered_focal_mecha = df_focal_mechanisms[(df_focal_mechanisms.MAG < magnitude_filter)]
        # focal mechanisms with earthquake magnitude greater than or equal to the magnitude filter
        df_offset_mag_filtered_focal_mecha =df_focal_mechanisms[(df_focal_mechanisms.MAG >= magnitude_filter)]

        # reads the unmodifed magnitude of the focal mechanisms that will be offset into a list so it can be later used to label them
        fm_label = []
        for i in df_offset_mag_filtered_focal_mecha.MAG:
            fm_label.append(i)

        fm_dataframes = [df_mag_filtered_focal_mecha, df_offset_mag_filtered_focal_mecha]

        # iterates through each focal mechanism dataframe and scales them expoentially so that they will be plotted as exponentially larger sizes, and resets the index in place while not including the old index as a column which is done for tidyness 
        for dataframe in fm_dataframes:
            dataframe.reset_index(inplace=True, drop=True)
            dataframe['MAG'] = 0.1 * (2 ** dataframe.MAG)

        # new dataframes to hold only the columns used for the "aki" focal mechanism format
        fm_aki_format = pd.DataFrame()
        fm_aki_format_offset = pd.DataFrame()
        aki_dataframes = [fm_aki_format, fm_aki_format_offset]
        # column names of the aki format, with keys being columns from the focal mechanism dataframes and values being the new column names to be used
        aki_format_attributes = {'LON':'longitude', 'LAT':'latitude', 'DEPTH':'depth', 'STRIKE':'strike', 'DIP':'dip', 'RAKE':'rake', 'MAG':'magnitude'}

        # add the desired columns for the 'aki' focal mechanism format to the new dataframes in the desired order
        for aki_data, fm_data in zip(aki_dataframes, fm_dataframes):
            for key, value in aki_format_attributes.items():
                aki_data[value] = fm_data[key]

        # offset coordinates (lon:lat) used for offsetting the selected focal mechanisms
        offset_coordinates = {-117.70:35.78}
        fm_aki_format_offset['offset_longitude'] = offset_coordinates.keys()
        fm_aki_format_offset['offset_latitude'] = offset_coordinates.values()

        # adds label data for plotting above each focal mechanism beachball
        fm_aki_format_offset['label_mag'] = fm_label

        # path to the "small" EQ focal mechanisms 
        focal_mechanisms_lesser_output =  os.path.join(self.main_dir, 'Data', 'focal_mechanism_data_less_than_M{}.csv').format(magnitude_filter)
        # path to the "large" EQ focal mechanisms 
        focal_mechanisms_greater_output =  os.path.join(self.main_dir, 'Data', 'focal_mechanism_data_greater_than_or_equal_to_M{}.csv').format(magnitude_filter)
        focal_mechanism_outputs = [focal_mechanisms_lesser_output, focal_mechanisms_greater_output]

        # writes the aki format dataframes to csv files, leaving out the header. This is important because if the header is included, fig.meca will plot the header text
        for dataframe, path in zip(aki_dataframes, focal_mechanism_outputs):
            dataframe.to_csv(path, sep='\t', index=False, header=None)

        return fm_depths, fm_mags, magnitude_filter

Creating The Legend

When the focal mechanisms “beach-balls” are eventually plotted on a map, the size differences will need to be given context with a legend. For this kind of legend, the PyGMT legend function needs to be passed a postscript file.

The following demo script function creates a postscript file for the legend:

# Creates a postscript legend file
def Create_Legend(self, fm_mags):
    import os
    import math

    # File path to postscript legend file to be created
    focal_mechanism_legend = os.path.join(self.main_dir, 'Data', 'focal_mechanism_legend.txt')

    # Creates a postscript file and writes some explainer, legend header text, and the column format
    with open(focal_mechanism_legend, 'w') as f:
        f.write(
            '# G is vertical gap, V is vertical line, N sets # of columns,\n'
            '# D draws horizontal line, H is header, L is column header,\n'
            '# S is symbol 
   
    
     
      
       
        \n' '\n' 'H 12p,Helvetica Magnitude\n' 'D 0.1i 1p\n' 'G 0.05i\n' 'N 1\n' '\n' ) # sets the index to the minimum magnitude of the unified dataset. This is used to set the minimum size for the circles used to represent magnitude within the legend, as well as label them i = math.floor(fm_mags.min()) # sets the vertical space between each magnitude circle/text line v_spacer = 0.08 # creteas a legend entry for each integer magnitude within the dataset and appends it to the legend file with open(focal_mechanism_legend, 'a') as f: while i <= round(fm_mags.max(), 0):\ # replicates the exponential scaling of the magnitide and linear scaling of the fig.meca function so that the magnitude circles in the legend are the same size as the plotted focal mechanisms size = 0.1*(0.1*(2**i)) size = round(size, 2) # creates a legend of transparent circles that are labeld with the associated magnitude f.write( 'S 0.20i c {} [email protected] 0.5p 0.6i M{}\n' 'G {}i\n' .format(size, i, v_spacer) ) # exponentially scales the vertical spacing between each legend entry so that they are evenly spaced in this particular demo v_spacer = v_spacer**0.5 i += 1 
       
      
     
    
   

Building The Map

Now that the focal mechanism data and legend have been properly prepared, it’s time to plot everything on a map.

The following demo script function plots focal mechanism “beach-balls” over an automatically downloaded 3 arc second Digital Elevation Model from the Shuttle Radar Topography Mission. The “beach-balls” are scaled exponentially in size by the magnitude and colored by depth, with magnitude, and depth legends plotted along the map axes. An inset map displaying the study region relative to the greater region around it is plotted in the upper right corner of the map:

+ + / legend_position = 'JMR+w1.05i+o0.15i/-0.02i' # + #legend_box = '+gwhite+p1p' ### INSET MAP ----------------------------------------------------------------------------- # extent of the inset map i_region = [-130, -105, 27, 45] i_projection = 'M1.75i' # sets the border types, line thickness, and color . In this case 1 = national boundaries, 2 = state boundaries within America i_borders = ['1/0.8p,gray40', '2/0.8p,gray40'] # sets the color of the land i_land = 'gray' # sets the shorline type, line thickness, and color . In this case, 1 = coastline i_shorelines = '1/0.1p,gray40' i_pen = '1p,black' # sets the water color i_water = 'azure2' # shifts the inset map in the x-direction. Positive numbers shift up, negative numbers shifts down. i_xshift = '12.5c' # shifts the inset map in the y-direction. Positive numbers shift up, negative numbers shifts down. i_yshift ='11.0c' # first two list elements of 'rectangle' are the longitude and latitude of the bottom left corner of the rectangle, and the last two elements are the longitude and latitude of the uppper right corner. rectangle = [[region[0], region[2], region[1], region[3]]] # sets style of plot as rectagle (r) with first two list items as the longitude and latitude of the bottom left corner of the rectangle, and the last two list items as the longitude and latitude of the uppper right corner (+s) i_style = 'r+s' # sets an auto-detrmined frame with ticks in intervals of 10 (a10), then displays the frame with ticks on the top and right sides of the map (NE), but doesn't show ticks for the left and bottoms sides (sw) i_frame = ['a10', 'swNE'] ### Save File ----------------------------------------------------------------------------- # map save name save_name = os.path.join(self.main_dir, 'Results', 'Focal_Mechanism_Demo.png') # sets the transparency of the white space around the map save_transparency = False # Establishes a figure to hold map layers fig = pygmt.Figure() # Forces Lat/Lon to display as degree decimal pygmt.config(FORMAT_GEO_MAP = 'D') # Forces Lat/Lon to display with two decimal places , as opposed the default that limits by significan digits pygmt.config(FORMAT_FLOAT_OUT = '%.2f') # Forces the map frame annotation to be smaller pygmt.config(FONT_ANNOT_PRIMARY = '10p,Helvetica,black') # Forces the scale font to be smaller pygmt.config(FONT_LABEL = '10p,Helvetica,black') # Basemap layer fig.basemap( region = region, projection = projection, frame = frame ) # topography layer fig.grdimage( # downloads a 3 arc second shuttle radar topography mission digital elevation model of the region extent '@srtm_relief_03s', # applies shading to the grid shading = True, cmap = grid_cmap, ) depth_series = [fm_depths.min(), fm_depths.max()] # makes a color palette table to color the events by depth pygmt.makecpt( cmap = depth_color, series = depth_series ) for focal_mechanism in focal_mechanisms: fig.meca( # requires a file to be provided directly to the spec parameter if offseting the focal mechanisms is desired spec = focal_mechanism, # sets the focal mechanism convention convention = convention, # linear scaling factor with respect to M5 earthquakes scale = fm_scale, # sets the focal mechanisms to be colored by the previously created color palette table C = True, # controls whether to offset the focal mechanims offset = fm_offset, ) # Plots the color bar for depth fig.colorbar( frame = cbar_frame ) # plots the legend fig.legend( spec = legend, position = legend_position, ) # plots the map scale fig.basemap( map_scale = map_scale ) # Plots a mini coast map as an offset inset map fig.coast( region = i_region, projection = i_projection, frame = i_frame, land = i_land, borders = i_borders, shorelines = i_shorelines, water = i_water, xshift = i_xshift, yshift = i_yshift ) # Plots a rectangle of the study area in the inset map fig.plot( data = rectangle, style = i_style, pen = i_pen, projection = i_projection ) # Saves a copy of the generated figure fig.savefig(save_name, transparent = save_transparency) print('Map Saved!') ">
    # Plots the map    
    def Plot_Map(self, fm_depths, magnitude_filter):
        import os
        import pygmt

        print('Building map...')

        ### BASEMAP -----------------------------------------------------------------------------
        # sets the region to be displayed in the map 
                    
                     
                      
                       
                        
        region = [-118.0, -117.15, 35.5, 36.1]  
        # map projection (Mercator): 
                        
                         
                          
                            projection = 'M6i' # frame annotations: [, 
                           
                            , 
                            
                             ] frame = ['SWne', 'xa', 'ya'] # map scale - displays a fancy (f) distance scale (lScale) in kilometers (u). Format of 
                             
                              
                               
                                /
                                
                                 /
                                 
                                  +
                                  
                                   +
                                   
                                  
                                 
                                
                               
                              
                             
                            
                           
                          
                         
                        
                       
                      
                     
                    

Result

I hope that this has been helpful for anyone looking to plot and offset focal mechanisms with PyGMT.

Complete Code

< magnitude_filter)] # focal mechanisms with earthquake magnitude greater than or equal to the magnitude filter df_offset_mag_filtered_focal_mecha =df_focal_mechanisms[(df_focal_mechanisms.MAG >= magnitude_filter)] # reads the unmodifed magnitude of the focal mechanisms that will be offset into a list so it can be later used to label them fm_label = [] for i in df_offset_mag_filtered_focal_mecha.MAG: fm_label.append(i) fm_dataframes = [df_mag_filtered_focal_mecha, df_offset_mag_filtered_focal_mecha] # iterates through each focal mechanism dataframe and scales them expoentially so that they will be plotted as exponentially larger sizes, and resets the index in place while not including the old index as a column which is done for tidyness for dataframe in fm_dataframes: dataframe.reset_index(inplace=True, drop=True) dataframe['MAG'] = 0.1 * (2 ** dataframe.MAG) # new dataframes to hold only the columns used for the "aki" focal mechanism format fm_aki_format = pd.DataFrame() fm_aki_format_offset = pd.DataFrame() aki_dataframes = [fm_aki_format, fm_aki_format_offset] # column names of the aki format, with keys being columns from the focal mechanism dataframes and values being the new column names to be used aki_format_attributes = {'LON':'longitude', 'LAT':'latitude', 'DEPTH':'depth', 'STRIKE':'strike', 'DIP':'dip', 'RAKE':'rake', 'MAG':'magnitude'} # add the desired columns for the 'aki' focal mechanism format to the new dataframes in the desired order for aki_data, fm_data in zip(aki_dataframes, fm_dataframes): for key, value in aki_format_attributes.items(): aki_data[value] = fm_data[key] # offset coordinates (lon:lat) used for offsetting the selected focal mechanisms offset_coordinates = {-117.70:35.78} fm_aki_format_offset['offset_longitude'] = offset_coordinates.keys() fm_aki_format_offset['offset_latitude'] = offset_coordinates.values() # adds label data for plotting above each focal mechanism beachball fm_aki_format_offset['label_mag'] = fm_label # path to the "small" EQ focal mechanisms focal_mechanisms_lesser_output = os.path.join(self.main_dir, 'Data', 'focal_mechanism_data_less_than_M{}.csv').format(magnitude_filter) # path to the "large" EQ focal mechanisms focal_mechanisms_greater_output = os.path.join(self.main_dir, 'Data', 'focal_mechanism_data_greater_than_or_equal_to_M{}.csv').format(magnitude_filter) focal_mechanism_outputs = [focal_mechanisms_lesser_output, focal_mechanisms_greater_output] # writes the aki format dataframes to csv files, leaving out the header. This is important because if the header is included, fig.meca will plot the header text for dataframe, path in zip(aki_dataframes, focal_mechanism_outputs): dataframe.to_csv(path, sep='\t', index=False, header=None) return fm_depths, fm_mags, magnitude_filter # Creates a postscript legend file def Create_Legend(self, fm_mags): import os import math # File path to postscript legend file to be created focal_mechanism_legend = os.path.join(self.main_dir, 'Data', 'focal_mechanism_legend.txt') # Creates a postscript file and writes some explainer, legend header text, and the column format with open(focal_mechanism_legend, 'w') as f: f.write( '# G is vertical gap, V is vertical line, N sets # of columns,\n' '# D draws horizontal line, H is header, L is column header,\n' '# S is symbol \n' '\n' 'H 12p,Helvetica Magnitude\n' 'D 0.1i 1p\n' 'G 0.05i\n' 'N 1\n' '\n' ) # sets the index to the minimum magnitude of the unified dataset. This is used to set the minimum size for the circles used to represent magnitude within the legend, as well as label them i = math.floor(fm_mags.min()) # sets the vertical space between each magnitude circle/text line v_spacer = 0.08 # creteas a legend entry for each integer magnitude within the dataset and appends it to the legend file with open(focal_mechanism_legend, 'a') as f: while i <= round(fm_mags.max(), 0):\ # replicates the exponential scaling of the magnitide and linear scaling of the fig.meca function so that the magnitude circles in the legend are the same size as the plotted focal mechanisms size = 0.1*(0.1*(2**i)) size = round(size, 2) # creates a legend of transparent circles that are labeld with the associated magnitude f.write( 'S 0.20i c {} [email protected] 0.5p 0.6i M{}\n' 'G {}i\n' .format(size, i, v_spacer) ) # exponentially scales the vertical spacing between each legend entry so that they are evenly spaced in this particular demo v_spacer = v_spacer**0.5 i += 1 # Plots the map def Plot_Map(self, fm_depths, magnitude_filter): import os import pygmt print('Building map...') ### BASEMAP ----------------------------------------------------------------------------- # sets the region to be displayed in the map region = [-118.0, -117.15, 35.5, 36.1] # map projection (Mercator): projection = 'M6i' # frame annotations: [, , ] frame = ['SWne', 'xa', 'ya'] # map scale - displays a fancy (f) distance scale (lScale) in kilometers (u). Format of / / + +
A simple script that displays pixel-based animation on GitHub Activity

GitHub Activity Animator This project contains a simple Javascript snippet that produces an animation on your GitHub activity tracker. The project als

16 Nov 15, 2021
A command line tool for visualizing CSV/spreadsheet-like data

PerfPlotter Read data from CSV files using pandas and generate interactive plots using bokeh, which can then be embedded into HTML pages and served by

Gino Mempin 0 Jun 25, 2022
:art: Diagram as Code for prototyping cloud system architectures

Diagrams Diagram as Code. Diagrams lets you draw the cloud system architecture in Python code. It was born for prototyping a new system architecture d

MinJae Kwon 27.5k Dec 30, 2022
PolytopeSampler is a Matlab implementation of constrained Riemannian Hamiltonian Monte Carlo for sampling from high dimensional disributions on polytopes

PolytopeSampler PolytopeSampler is a Matlab implementation of constrained Riemannian Hamiltonian Monte Carlo for sampling from high dimensional disrib

9 Sep 26, 2022
Plot, scatter plots and histograms in the terminal using braille dots

Plot, scatter plots and histograms in the terminal using braille dots, with (almost) no dependancies. Plot with color or make complex figures - similar to a very small sibling to matplotlib. Or use t

Tammo Ippen 207 Dec 30, 2022
Generate knowledge graphs with interesting geometries, like lattices

Geometric Graphs Generate knowledge graphs with interesting geometries, like lattices. Works on Python 3.9+ because it uses cool new features. Get out

Charles Tapley Hoyt 5 Jan 03, 2022
Arras.io Highest Scores Over Time Bar Chart Race

Arras.io Highest Scores Over Time Bar Chart Race This repo contains a python script (make_racing_bar_chart.py) that can generate a csv file which can

Road 2 Jan 16, 2022
The open-source tool for building high-quality datasets and computer vision models

The open-source tool for building high-quality datasets and computer vision models. Website • Docs • Try it Now • Tutorials • Examples • Blog • Commun

Voxel51 2.4k Jan 07, 2023
Generate visualizations of GitHub user and repository statistics using GitHub Actions.

GitHub Stats Visualization Generate visualizations of GitHub user and repository statistics using GitHub Actions. This project is currently a work-in-

JoelImgu 3 Dec 14, 2022
Streamlit-template - A streamlit app template based on streamlit-option-menu

streamlit-template A streamlit app template for geospatial applications based on

Qiusheng Wu 41 Dec 10, 2022
Tandem Mass Spectrum Prediction with Graph Transformers

MassFormer This is the original implementation of MassFormer, a graph transformer for small molecule MS/MS prediction. Check out the preprint on arxiv

Röst Lab 13 Oct 27, 2022
A napari plugin for visualising and interacting with electron cryotomograms.

napari-tomoslice A napari plugin for visualising and interacting with electron cryotomograms. Installation You can install napari-tomoslice via pip: p

3 Jan 03, 2023
A Python-based non-fungible token (NFT) generator built using Samilla and Matplotlib

PyNFT A Pythonic NF (non-fungible token) generator built using Samilla and Matplotlib Use python pynft.py [amount] The intention behind this generato

Ayush Gundawar 6 Feb 07, 2022
mysql relation charts

sqlcharts 自动生成数据库关联关系图 复制settings.py.example 重命名为settings.py 将数据库配置信息填入settings.DATABASE,目前支持mysql和postgresql 执行 python build.py -b,-b是读取数据库表结构,如果只更新匹

6 Aug 22, 2022
Browse Dash docsets inside emacs

Helm Dash What's it This package uses Dash docsets inside emacs to browse documentation. Here's an article explaining the basic usage of it. It doesn'

504 Dec 15, 2022
Lumen provides a framework for visual analytics, which allows users to build data-driven dashboards from a simple yaml specification

Lumen project provides a framework for visual analytics, which allows users to build data-driven dashboards from a simple yaml specification

HoloViz 120 Jan 04, 2023
Automatically Visualize any dataset, any size with a single line of code. Created by Ram Seshadri. Collaborators Welcome. Permission Granted upon Request.

AutoViz Automatically Visualize any dataset, any size with a single line of code. AutoViz performs automatic visualization of any dataset with one lin

AutoViz and Auto_ViML 1k Jan 02, 2023
Plotting library for IPython/Jupyter notebooks

bqplot 2-D plotting library for Project Jupyter Introduction bqplot is a 2-D visualization system for Jupyter, based on the constructs of the Grammar

3.4k Dec 30, 2022
Visualize large time-series data in plotly

plotly_resampler enables visualizing large sequential data by adding resampling functionality to Plotly figures. In this Plotly-Resampler demo over 11

PreDiCT.IDLab 604 Dec 28, 2022
Statistical data visualization using matplotlib

seaborn: statistical data visualization Seaborn is a Python visualization library based on matplotlib. It provides a high-level interface for drawing

Michael Waskom 10.2k Dec 30, 2022