Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 7ce9a88
  • /
  • spec_plot.py
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:7d52841baa7ba51adb0ab737e08a5ee42a863496
directory badge Iframe embedding
swh:1:dir:7ce9a88092d9671483dc9eb89d59650d3e300db6
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
spec_plot.py
from bokeh.plotting import figure
from src.mycolors import mycolors

def spec_plot(datalist,colorlist=None,**kwargs):
    golden=1.61803
    height=400
    #plot_width=int(height*golden)
    if 'plot_height' not in kwargs:
        kwargs['plot_height']= height
        kwargs['plot_width']=int(height*golden)
    if 'plot_width' not in kwargs:
        kwargs['plot_width']=int(kwargs['plot_height']*golden)
        
    myplot=figure(**kwargs)
    myplot.outline_line_alpha=0
    
    #Xaxis prefs
    myplot.xgrid.grid_line_color = None
    myplot.xaxis.axis_label="Evolution Time (μs)"
    myplot.xaxis.axis_label_text_font='helvetica'
    myplot.xaxis.axis_label_text_font_style='normal'
    myplot.xaxis.axis_label_text_font_size='24pt'
    myplot.xaxis.major_label_text_font='helvetica'
    myplot.xaxis.major_label_text_font_size='16pt'

    #Yaxis prefs
    myplot.ygrid.grid_line_alpha = 0.5
    myplot.ygrid.grid_line_dash = [6, 4]
    myplot.yaxis.major_label_text_font='helvetica'
    myplot.yaxis.major_label_text_font_size='16pt'

    if not colorlist: #if colorlist is not present, use default scheme
        for i in range(int(len(datalist)/2)):
            myplot.line(datalist[i*2],datalist[i*2+1], color=mycolors(i), line_width=1)
        return myplot
    else:
        for i in range(int(len(datalist)/2)):
            myplot.line(datalist[i*2],datalist[i*2+1], color=colorlist[i], line_width=1)
        return myplot

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API