Package: visdom
Creating, organizing & sharing visualizations of live, rich data. SupportsPython.Jump To:Setup,Usage,API,Customizing,Contributing,LicenseVisdom aims to facilitate visualization of (remote) data with an emphasis on supporting scientific experimentation.Broadcast visualizations of plots, images, and text for yourself and your collaborators.
Organize your visualization space programmatically or through the UI to create dashboards for live data, inspect results of experiments, or debug experimental code.ConceptsVisdom has a simple set of features that can be composed for various use-cases.WindowsThe UI begins as a blank slate – you can populate it with plots, images, and text. These appear in windows that you can drag, drop, resize, and destroy. The windows live inenvsand the state ofenvsis stored across sessions. You can download the content of windows – including your plots insvg.Tip: You can use the zoom of your browser to adjust the scale of the UI.CallbacksThe python Visdom implementation supports callbacks on a window. The demo shows an example of this in the form of an editable text pad. The functionality of these callbacks allows the Visdom object to receive and react to events that happen in the frontend.You can subscribe a window to events by adding a function to the event handlers dict for the window id you want to subscribe by callingviz.register_event_handler(handler, win_id)with your handler and the window id. Multiple handlers can be registered to the same window. You can remove all event handlers from a window usingviz.clear_event_handlers(win_id). When an event occurs to that window, your callbacks will be called on a dict containing:event_type: one of the below event typespane_data: all of the stored contents for that window including layout and content.eid: the current environment idtarget: the window id the event is called onAdditional parameters are defined below.Right now the following callback events are supported:Close- Triggers when a window is closed. Returns a dict with only the aforementioned fields.KeyPress- Triggers when a key is pressed. Contains additional parameters:key- A string representation of the key pressed (applying state modifiers such as SHIFT)key_code- The javascript event keycode for the pressed key (no modifiers)PropertyUpdate- Triggers when a property is updated in Property panepropertyId- Position in properties listvalue- New property valueClick- Triggers when Image pane is clicked on, has a parameter:image_coord- dictionary with the fieldsxandyfor the click coordinates in the coordinate frame of the possibly zoomed/panned image (notthe enclosing pane).Editable Plot ParametersUse the top-right *edit*-Button to inspect all parameters used for plot in the respective window.  
The visdom client supports dynamic change of plot parameters as well. Just change one of the listed parameters, the plot will be altered on-the-fly.  
Click the button again to close the property list.EnvironmentsYou can partition your visualization space withenvs. By default, every user will have an env calledmain. New envs can be created in the UI or programmatically. The state of envs is chronically saved. Environments are able to keep entirely different pools of plots.You can access a specific env via url:http://localhost.com:8097/env/main. If your server is hosted, you can share this url so others can see your visualizations too.Environments are automatically hierarchically organized by the first_.Selecting EnvironmentsFrom the main page it is possible to toggle between different environments using the environment selector. Selecting a new environment will query the server for the plots that exist in that environment. The environment selector allows for searching and filtering for the new enironment.Comparing EnvironmentsFrom the main page it is possible to compare different environments using the environment selector. Selecting multiple environments in the check box will query the server for the plots with the same titles in all environments and plot them in a single plot. An additional compare legend pane is created with a number corresponding to each selected environment. Individual plots are updated with legends corresponding to "x_name" wherexis a number corresponding with the compare legend pane andnameis the original name in the legend.Note: The compare envs view is not robust to high throughput data, as the server is responsible for generating the compared content. Do not compare an environment that is receiving a high quantity of updates on any plot, as every update will request regenerating the comparison. If you need to compare two plots that are receiving high quantities of data, have them share the same window on a singular env.Clearing EnvironmentsYou can use the eraser button to remove all of the current contents of an environment. This closes the plot windows for that environment but keeps the empty environment for new plots.Managing EnvironmentsPressing the folder icon opens a dialog that allows you to fork or force save the current environment, or delete any of your existing environments. Use of this feature is fully described in theStatesection.Env Files:Your envs are loaded upon request by the user, by default from$HOME/.visdom/. Custom paths can be passed as a cmd-line argument. Envs are removed by using the delete button or by deleting the corresponding.jsonfile from the env dir. In case you want the server to pre-load all files into cache, use the flag-eager_data_loading.StateOnce you've created a few visualizations, state is maintained. The server automatically caches your visualizations -- if you reload the page, your visualizations reappear.Save:You can manually do so with thesavebutton. This will serialize the env's state (to disk, in JSON), including window positions. You can save anenvprogrammatically.This is helpful for more sophisticated visualizations in which configuration is meaningful, e.g. a data-rich demo, a model training dashboard, or systematic experimentation. This also makes them easy to share and reuse.Fork:If you enter a new env name, saving will create a new env -- effectivelyforkingthe previous env.Tip: Fork an environment before you begin to make edits to ensure that your changes are saved seperately.FilterYou can use thefilterto dynamically sift through windows present in an env -- just provide a regular expression with which to match titles of window you want to show. This can be helpful in use cases involving an env with many windows e.g. when systematically checking experimental results.Note: If you have saved your current view, the view will be restored after clearing the filter.ViewsIt is possible to manage the views simply by dragging the tops of windows around, however additional features exist to keep views organized and save common views. View management can be useful for saving and switching between multiple common organizations of your windows.Saving/Deleting ViewsUsing the folder icon, a dialog window opens where views can be forked in the same way that envs can be. Saving a view will retain the position and sizes of all of the windows in a given environment. Views are saved in$HOME/.visdom/view/layouts.jsonin the visdom filepath.Note: Saved views are static, and editing a saved view copies that view over to thecurrentview where editing can occur.Re-PackingUsing the repack icon (9 boxes), visdom will attempt to pack your windows in a way that they best fit while retaining row/column ordering.Note: Due to the reliance on row/column ordering andReactGridLayoutthe final layout might be slightly different than what might be expected. We're working on improving that experience or providing alternatives that give more fine-tuned control.Reloading ViewsUsing the view dropdown it is possible to select previously saved views, restoring the locations and sizes of all of the windows within the current environment to the places they were when that view was saved last.SetupPython and web clients come bundled with the python server.Install from pip>pipinstallvisdomInstall from source>pipinstallgit+https://github.com/fossasia/visdomUsageStart the server (probably in ascreenortmux) from the command line:>visdomVisdom now can be accessed by going tohttp://localhost:8097in your browser, or your own host address if specified.Thevisdomcommand is equivalent to runningpython -m visdom.server.If the above does not work, try using an SSH tunnel to your server by adding the following line to your local~/.ssh/config:LocalForward 127.0.0.1:8097 127.0.0.1:8097.Command Line OptionsThe following options can be provided to the server:-port: The port to run the server on.-hostname: The hostname to run the server on.-base_url: The base server url (default = /).-env_path: The path to the serialized session to reload.-logging_level: Logging level (default = INFO). Accepts both standard text and numeric logging values.-readonly: Flag to start server in readonly mode.-enable_login: Flag to setup authentication for the sever, requiring a username and password to login.-force_new_cookie: Flag to reset the secure cookie used by the server, invalidating current login cookies.
Requires-enable_login.-bind_local: Flag to make the server accessible only from localhost.-eager_data_loading: By default visdom loads environments lazily upon user request. Setting this flag lets visdom pre-fetch all environments upon startup.When-enable_loginflag is provided, the server asks user to input credentials using terminal prompt. Alternatively,
you can setupVISDOM_USE_ENV_CREDENTIALSenv variable, and then provide your username and password viaVISDOM_USERNAMEandVISDOM_PASSWORDenv variables without manually interacting with the terminal. This setup
is useful in case if you would like to launchvisdomserver from bash script, or from Jupyter notebook.VISDOM_USERNAME=usernameVISDOM_PASSWORD=passwordVISDOM_USE_ENV_CREDENTIALS=1visdom-enable_loginYou can also useVISDOM_COOKIEvariable to provide cookies value if the cookie file wasn't generated, or the
flag-force_new_cookiewas set.Python exampleimportvisdomimportnumpyasnpvis=visdom.Visdom()vis.text('Hello, world!')vis.image(np.ones((3,10,10)))DemosIf you have cloned this repository, you can run our demo showcase.pythonexample/demo.pyAPIFor a quick introduction into the capabilities ofvisdom, have a look at theexampledirectory, or read the details below.Visdom Arguments (Python only)The python visdom client takes a few options:server: the hostname of your visdom server (default:'http://localhost')port: the port for your visdom server (default:8097)base_url: the base visdom server url (default:/)env: Default environment to plot to when noenvis provided (default:main)raise_exceptions: Raise exceptions upon failure rather than printing them (default:True(soon))log_to_filename: If not none, log all plotting and updating events to the given file (append mode) so that they can be replayed later usingreplay_log(default:None)use_incoming_socket: enable use of the socket for receiving events from the web client, allowing user to register callbacks (default:True)http_proxy_host: Deprecated. Use Proxies argument for complete proxy support.http_proxy_port: Deprecated. Use Proxies argument for complete proxy support.username: username to use for authentication, if server started with-enable_login(default:None)password: password to use for authentication, if server started with-enable_login(default:None)proxies: Dictionary mapping protocol to the URL of the proxy (e.g. {http:foo.bar:3128}) to be used on each Request. (default:None)offline: Flag to run visdom in offline mode, where all requests are logged to file rather than to the server. Requireslog_to_filenameis set. In offline mode, all visdom commands that don't create or update plots will simply returnTrue. (default:False)Other options are either currently unused (endpoint, ipv6) or used for internal functionality.BasicsVisdom offers the following basic visualization functions:vis.image: imagevis.images: list of imagesvis.text: arbitrary HTMLvis.properties: properties gridvis.audio: audiovis.video: videosvis.svg: SVG objectvis.matplot: matplotlib plotvis.save: serialize state server-sidePlottingWe have wrapped several common plot types to make creating basic visualizations easily. These visualizations are powered byPlotly.The following API is currently supported:vis.scatter: 2D or 3D scatter plotsvis.line: line plotsvis.stem: stem plotsvis.heatmap: heatmap plotsvis.bar: bar graphsvis.histogram: histogramsvis.boxplot: boxplotsvis.surf: surface plotsvis.contour: contour plotsvis.quiver: quiver plotsvis.mesh: mesh plotsvis.dual_axis_lines: double y axis line plotsGeneric PlotsNote that the server API adheres to the Plotly convention ofdataandlayoutobjects, such that you can produce your own arbitraryPlotlyvisualizations:importvisdomvis=visdom.Visdom()trace=dict(x=[1,2,3],y=[4,5,6],mode="markers+lines",type='custom',marker={'color':'red','symbol':104,'size':"10"},text=["one","two","three"],name='1st Trace')layout=dict(title="First Plot",xaxis={'title':'x1'},yaxis={'title':'x2'})vis._send({'data':[trace],'layout':layout,'win':'mywin'})Othersvis.close: close a window by idvis.delete_env: delete an environment by env_idvis.win_exists: check if a window already exists by idvis.get_env_list: get a list of all of the environments on your servervis.win_hash: get md5 hash of window's contentsvis.get_window_data: get current data for a windowvis.check_connection: check if the server is connectedvis.replay_log: replay the actions from the provided log fileDetailsBasicsvis.imageThis function draws animg. It takes as input anCxHxWtensorimgthat contains the image.The followingoptsare supported:jpgquality: JPG quality (number0-100). If defined image will be saved as JPG to reduce file size. If not defined image will be saved as PNG.caption: Caption for the imagestore_history: Keep all images stored to the same window and attach a slider to the bottom that will let you select the image to view. You must always provide this opt when sending new images to an image with history.NoteYou can use alt on an image pane to view the x/y coordinates of the cursor. You can also ctrl-scroll to zoom, alt scroll to pan vertically, and alt-shift scroll to pan horizontally. Double click inside the pane to restore the image to default.vis.imagesThis function draws a list ofimages. It takes an inputB x C x H x Wtensor or alist of imagesall of the same size. It makes a grid of images of size (B / nrow, nrow).The following arguments andoptsare supported:nrow: Number of images in a rowpadding: Padding around the image, equal padding around all 4 sidesopts.jpgquality: JPG quality (number0-100). If defined image will be saved as JPG to reduce file size. If not defined image will be saved as PNG.opts.caption: Caption for the imagevis.textThis function prints text in a  box. You can use this to embed arbitrary HTML.
It takes as input atextstring.
No specificoptsare currently supported.vis.propertiesThis function shows editable properties in a pane. Properties are expected to be a List of Dicts e.g.:properties = [
        {'type': 'text', 'name': 'Text input', 'value': 'initial'},
        {'type': 'number', 'name': 'Number input', 'value': '12'},
        {'type': 'button', 'name': 'Button', 'value': 'Start'},
        {'type': 'checkbox', 'name': 'Checkbox', 'value': True},
        {'type': 'select', 'name': 'Select', 'value': 1, 'values': ['Red', 'Green', 'Blue']},
    ]Supported types:text: stringnumber: decimal numberbutton: button labeled with "value"checkbox: boolean value rendered as a checkboxselect: multiple values select boxvalue: id of selected value (zero based)values: list of possible valuesCallback are called on property value update:event_type:"PropertyUpdate"propertyId: position in thepropertieslistvalue: new valueNo specificoptsare currently supported.vis.audioThis function plays audio. It takes as input the filename of the audio
file or anNtensor containing the waveform (use anNx2matrix for stereo
audio). The function does not support any plot-specificopts.The followingoptsare supported:opts.sample_frequency: sample frequency (integer> 0; default = 44100)Known issue: Visdom uses scipy to convert tensor inputs to wave files. Some
versions of Chrome are known not to play these wave files (Firefox and Safari work fine).vis.videoThis function plays a video. It takes as input the filename of the videovideofileor aLxHxWxC-sizedtensorcontaining all the frames of the video as input. The
function does not support any plot-specificopts.The followingoptsare supported:opts.fps: FPS for the video (integer> 0; default = 25)Note: Usingtensorinput requires that ffmpeg is installed and working.
Your ability to play video may depend on the browser you use: your browser has
to support the Theano codec in an OGG container (Chrome supports this).vis.svgThis function draws an SVG object. It takes as input a SVG stringsvgstror
the name of an SVG filesvgfile. The function does not support any specificopts.vis.matplotThis function draws a Matplotlibplot. The function supports
one plot-specific option:resizable.NoteWhen set toTruethe plot is resized with the
pane. You needbeautifulsoup4andlxmlpackages installed to use this option.Note:matplotis not rendered using the same backend as plotly plots, and is somewhat less efficient. Using too many matplot windows may degrade visdom performance.vis.plotlyplotThis function draws a PlotlyFigureobject. It does not explicitly take options as it assumes you have already explicitly configured the figure'slayout.NoteYou must have theplotlyPython package installed to use this function. It can typically be installed by runningpip install plotly.vis.embeddingsThis function visualizes a collection of features using theBarnes-Hut t-SNE algorithm.The function accepts the following arguments:features: a list of tensorslabels: a list of corresponding labels for the tensors provided forfeaturesdata_getter=fn: (optional) a function that takes as a parameter an index into the features array and returns a summary representation of the tensor. If this is set,data_typemust also be set.data_type=str: (optional) currently the only acceptable value here is"html"We currently assume that there are no more than 10 unique labels, in the future we hope to provide a colormap in opts for other cases.From the UI you can also draw a lasso around a subset of features. This will rerun the t-SNE visualization on the selected subset.vis.saveThis function saves theenvsthat are alive on the visdom server. It takes input a list of env ids to be saved.PlottingFurther details on the wrapped plotting functions are given below.The exact inputs into the plotting functions vary, although most of them take as input a tensorXthan contains the data and an (optional) tensorYthat contains optional data variables (such as labels or timestamps). All plotting functions take as input an optionalwinthat can be used to plot into a specific window; each plotting function also returns thewinof the window it plotted in. One can also specify theenvto which the visualization should be added.vis.scatterThis function draws a 2D or 3D scatter plot. It takes as input anNx2orNx3tensorXthat specifies the locations of theNpoints in the
scatter plot. An optionalNtensorYcontaining discrete labels that
range between1andKcan be specified as well -- the labels will be
reflected in the colors of the markers.updatecan be used to efficiently update the data of an existing plot. Use'append'to append data,'replace'to use new data, or'remove'to remove the trace specified byname.
Usingupdate='append'will create a plot if it doesn't exist and append to the existing plot otherwise.
If updating a single trace, usenameto specify the name of the trace to be updated. Update data that is all NaN is ignored (can be used for masking update).The followingoptsare supported:opts.markersymbol: marker symbol (string; default ='dot')opts.markersize: marker size (number; default ='10')opts.markercolor: color per marker. (torch.*Tensor; default =nil)opts.markerborderwidth: marker border line width (float; default = 0.5)opts.legend:tablecontaining legend namesopts.textlabels: text label for each point (list: default =None)opts.layoutopts: dict of any additional options that the graph backend accepts for a layout. For examplelayoutopts = {'plotly': {'legend': {'x':0, 'y':0}}}.opts.traceopts: dict mapping trace names or indices to dicts of additional options that the graph backend accepts. For exampletraceopts = {'plotly': {'myTrace': {'mode': 'markers'}}}.opts.webgl: use WebGL for plotting (boolean; default =false). It is faster if a plot contains too many points. Use sparingly as browsers won't allow more than a couple of WebGL contexts on a single page.opts.markercoloris a Tensor with Integer values. The tensor can be of sizeNorN x 3orKorK x 3.Tensor of sizeN: Single intensity value per data point. 0 = black, 255 = redTensor of sizeN x 3: Red, Green and Blue intensities per data point. 0,0,0 = black, 255,255,255 = whiteTensor of sizeKandK x 3: Instead of having a unique color per data point, the same color is shared for all points of a particular label.vis.sunburstThis function draws a sunburst chart. It takes two inputs:parentsandlabelsarray.
values fromparentsarray is used as parents object, like it define above which sector
should the this sector shown. values fromlabelsarray is used to define sector's label
or you can say name. keep in mind that lenght of arrayparentsandlabelsshould be
equal. There is a third array that you can pass to which isvalue, it is use to show
a value on hovering over a sector, it is optional argument, but if you are passing it then
keep in mind lenght ofvaluesshould be equal toparentsorlabels.Followingoptsare currently supported:opts.font_size: define font size of label (int)opts.font_color: define font color of label (string)opts.opacity: define opacity of chart (float)opts.line_width: define distance between two sectors and sector to its parents (int)vis.lineThis function draws a line plot. It takes as input anNorNxMtensorYthat specifies the values of theMlines (that connectNpoints)
to plot. It also takes an optionalXtensor that specifies the
corresponding x-axis values;Xcan be anNtensor (in which case all
lines will share the same x-axis values) or have the same size asY.updatecan be used to efficiently update the data of an existing plot. Use 'append' to append data, 'replace' to use new data, or 'remove' to remove the trace specified byname. If updating a single trace, usenameto specify the name of the trace to be updated. Update data that is all NaN is ignored (can be used for masking update).Smoothing: Line plots can be smoothened usingSavitzky-Golay filtering. This feature can be enabled by clicking the~-symbol in the top right corner of a window that contains a line plot.The followingoptsare supported:opts.fillarea: fill area below line (boolean)opts.markers: show markers (boolean; default =false)opts.markersymbol: marker symbol (string; default ='dot')opts.markersize: marker size (number; default ='10')opts.linecolor: line colors (np.array; default = None)opts.dash: line dash type for each line (np.array; default = 'solid'), one ofsolid,dash,dashdotordash, size should match number of lines being drawnopts.legend:tablecontaining legend namesopts.layoutopts:dictof any additional options that the graph backend accepts for a layout. For examplelayoutopts = {'plotly': {'legend': {'x':0, 'y':0}}}.opts.traceopts:dictmapping trace names or indices todicts of additional options that plot.ly accepts for a trace.opts.webgl: use WebGL for plotting (boolean; default =false). It is faster if a plot contains too many points. Use sparingly as browsers won't allow more than a couple of WebGL contexts on a single page.vis.stemThis function draws a stem plot. It takes as input anNorNxMtensorXthat specifies the values of theNpoints in theMtime series.
An optionalNorNxMtensorYcontaining timestamps can be specified
as well; ifYis anNtensor then allMtime series are assumed to
have the same timestamps.The followingoptsare supported:opts.colormap: colormap (string; default ='Viridis')opts.legend:tablecontaining legend namesopts.layoutopts:dictof any additional options that the graph backend accepts for a layout. For examplelayoutopts = {'plotly': {'legend': {'x':0, 'y':0}}}.vis.heatmapThis function draws a heatmap. It takes as input anNxMtensorXthat
specifies the value at each location in the heatmap.updatecan be used to efficiently update the data of an existing plot. Use 'appendRow' to append data row-wise, 'appendColumn' to append data column-wise, 'prependRow' to prepend data row-wise, 'prependColumn' to prepend data column-wise, 'replace' to use new data, or 'remove' to remove the plot specified bywin.The followingoptsare supported:opts.colormap: colormap (string; default ='Viridis')opts.xmin: clip minimum value (number; default =X:min())opts.xmax: clip maximum value (number; default =X:max())opts.columnnames:tablecontaining x-axis labelsopts.rownames:tablecontaining y-axis labelsopts.layoutopts:dictof any additional options that the graph backend accepts for a layout. For examplelayoutopts = {'plotly': {'legend': {'x':0, 'y':0}}}.opts.nancolor: color for plottingNaNs. If this isNone,NaNs will be plotted as transparent. (string; default =None)vis.barThis function draws a regular, stacked, or grouped bar plot. It takes as
input anNorNxMtensorXthat specifies the height of each of the
bars. IfXcontainsMcolumns, the values corresponding to each row
are either stacked or grouped (depending on howopts.stackedis
set). In addition toX, an (optional)NtensorYcan be specified
that contains the corresponding x-axis values.The following plot-specificoptsare currently supported:opts.rownames:tablecontaining x-axis labelsopts.stacked: stack multiple columns inXopts.legend:tablecontaining legend labelsopts.layoutopts:dictof any additional options that the graph backend accepts for a layout. For examplelayoutopts = {'plotly': {'legend': {'x':0, 'y':0}}}.vis.histogramThis function draws a histogram of the specified data. It takes as input
anNtensorXthat specifies the data of which to construct the
histogram.The following plot-specificoptsare currently supported:opts.numbins: number of bins (number; default = 30)opts.layoutopts:dictof any additional options that the graph backend accepts for a layout. For examplelayoutopts = {'plotly': {'legend': {'x':0, 'y':0}}}.vis.boxplotThis function draws boxplots of the specified data. It takes as input
anNor anNxMtensorXthat specifies theNdata values of which
to construct theMboxplots.The following plot-specificoptsare currently supported:opts.legend: labels for each of the columns inXopts.layoutopts:dictof any additional options that the graph backend accepts for a layout. For examplelayoutopts = {'plotly': {'legend': {'x':0, 'y':0}}}.vis.surfThis function draws a surface plot. It takes as input anNxMtensorXthat specifies the value at each location in the surface plot.The followingoptsare supported:opts.colormap: colormap (string; default ='Viridis')opts.xmin: clip minimum value (number; default =X:min())opts.xmax: clip maximum value (number; default =X:max())opts.layoutopts:dictof any additional options that the graph backend accepts for a layout. For examplelayoutopts = {'plotly': {'legend': {'x':0, 'y':0}}}.vis.contourThis function draws a contour plot. It takes as input anNxMtensorXthat specifies the value at each location in the contour plot.The followingoptsare supported:opts.colormap: colormap (string; default ='Viridis')opts.xmin: clip minimum value (number; default =X:min())opts.xmax: clip maximum value (number; default =X:max())opts.layoutopts:dictof any additional options that the graph backend accepts for a layout. For examplelayoutopts = {'plotly': {'legend': {'x':0, 'y':0}}}.vis.quiverThis function draws a quiver plot in which the direction and length of the
arrows is determined by theNxMtensorsXandY. Two optionalNxMtensorsgridXandgridYcan be provided that specify the offsets of
the arrows; by default, the arrows will be done on a regular grid.The followingoptsare supported:opts.normalize:  length of longest arrows (number)opts.arrowheads: show arrow heads (boolean; default =true)opts.layoutopts:dictof any additional options that the graph backend accepts for a layout. For examplelayoutopts = {'plotly': {'legend': {'x':0, 'y':0}}}.vis.meshThis function draws a mesh plot from a set of vertices defined in anNx2orNx3matrixX, and polygons defined in an optionalMx2orMx3matrixY.The followingoptsare supported:opts.color: color (string)opts.opacity: opacity of polygons (numberbetween 0 and 1)opts.layoutopts:dictof any additional options that the graph backend accepts for a layout. For examplelayoutopts = {'plotly': {'legend': {'x':0, 'y':0}}}.vis.dual_axis_linesThis function will create a line plot using plotly with different Y-Axis.X= A numpy array of the range.Y1= A numpy array of the same count asX.Y2= A numpy array of the same count asX.The followingoptsare supported:opts.height: Height of the plotopts.width:  Width of the plotopts.name_y1: Axis name for Y1 plotopts.name_y2: Axis name for Y2 plotopts.title:  Title of the plotopts.color_title_y1:  Color of the Y1 axis Titleopts.color_tick_y1:  Color of the Y1 axis Ticksopts.color_title_y2:  Color of the Y2 axis Titleopts.color_tick_y2:  Color of the Y2 axis Ticksopts.side:  side on which the Y2 tick has to be placed. Has values 'right' orleft.opts.showlegend:  Display legends (boolean values)opts.top:  Set the top margin of the plotopts.bottom:  Set the bottom margin of the plotopts.right:  Set the right margin of the plotopts.left:  Set the left margin of the plotThis is the image of the output:Network GraphThis function draws a graph, in which the nodes and edges are taken from a 2-D matrix of size [,2] where each row contains a source and destination node value. The numeric value used to define nodes should be strictly between (0 to n-1), where n is the number of nodes.There are two optional arguments :edgeLabels: list of custom edge labels. If not provided each edge gets a label, "source-destination", eg "1-2", size should be equal to size of input "edges". Optional.nodeLabels: list of custom node labels. If not provided each node gets a label same as the numeric value defined in the "edges". size should be equal to number of nodes present. Optional.The following opts are supported:opts.height: Height of the plot. Default : 500opts.width: Width of the plot. Default : 500opts.directed: whether the plot should have a arrow or not. Default : falseopts.showVertexLabels: Whether to show vertex labels. Default : trueopts.showEdgeLabels: Whether to show edge labels. Default : falseopts.scheme: Whether all nodes shoud have "same" color or "different". Default : "same"Customizing plotsThe plotting functions take an optionaloptstable as input that can be used to change (generic or plot-specific) properties of the plots.All input arguments are specified in a single table; the input arguments are matches based on the keys they have in the input table.The followingoptsare generic in the sense that they are the same for all visualizations (exceptplot.image,plot.text,plot.video, andplot.audio):opts.title: figure titleopts.width: figure widthopts.height: figure heightopts.showlegend: show legend (trueorfalse)opts.xtype: type of x-axis ('linear'or'log')opts.xlabel: label of x-axisopts.xtick: show ticks on x-axis (boolean)opts.xtickmin: first tick on x-axis (number)opts.xtickmax: last tick on x-axis (number)opts.xtickvals: locations of ticks on x-axis (tableofnumbers)opts.xticklabels: ticks labels on x-axis (tableofstrings)opts.xtickstep: distances between ticks on x-axis (number)opts.xtickfont: font for x-axis labels (dict offont information)opts.ytype: type of y-axis ('linear'or'log')opts.ylabel: label of y-axisopts.ytick: show ticks on y-axis (boolean)opts.ytickmin: first tick on y-axis (number)opts.ytickmax: last tick on y-axis (number)opts.ytickvals: locations of ticks on y-axis (tableofnumbers)opts.yticklabels: ticks labels on y-axis (tableofstrings)opts.ytickstep: distances between ticks on y-axis (number)opts.ytickfont: font for y-axis labels (dict offont information)opts.marginleft: left margin (in pixels)opts.marginright: right margin (in pixels)opts.margintop: top margin (in pixels)opts.marginbottom: bottom margin (in pixels)optsare passed as dictionary in python scripts.You can passoptslike:opts=dict(title="my title", xlabel="x axis",ylabel="y axis")ORopts={"title":"my title", "xlabel":"x axis","ylabel":"y axis"}The other options are visualization-specific, and are described in the
documentation of the functions.Othersvis.closeThis function closes a specific window. It takes input window idwinand environment ideid. UsewinasNoneto close all windows in an environment.vis.delete_envThis function deletes a specified env entirely. It takes env ideidas input.Note:delete_envis deletes all data for an environment and is IRREVERSIBLE. Do not use unless you absolutely want to remove an environment.vis.fork_envThis function forks an environment, similiar to the UI feature.Arguments:prev_eid: Environment ID that we want to fork.eid: New Environment ID that will be created with the fork.Note:fork_envan exception will occur if an env that doesn't exist is forked.vis.win_existsThis function returns a bool indicating whether or not a windowwinexists on the server already. Returns None if something went wrong.Optional arguments:env: Environment to search for the window in. Default isNone.vis.get_env_listThis function returns a list of all of the environments on the server at the time of calling. It takes no arguments.vis.win_hashThis function returns md5 hash of the contents of a windowwinif it exists on the server. Returns None otherwise.Optional arguments:env: Environment to search for the window in. Default isNone.vis.get_window_dataThis function returns the window data for the given window. Returns data for all windows in an env if win is None.Arguments:env: Environment to search for the window in.win: Window to return data for. Set toNoneto retrieve all the windows in an environment.vis.check_connectionThis function returns a bool indicating whether or not the server is connected. It accepts an optional argumenttimeout_secondsfor a number of seconds to wait for the server to come up.vis.replay_logThis function takes the contents of a visdom log and replays them to the current server to restore a state or handle any missing entries.Arguments:log_filename: log file to replay the contents of.Customizing VisdomThe user config directory for visdom is~/.config/visdomfor Linux~/Library/Preferences/visdomfor OSX%APPDATA%/visdomfor WindowsBy placing astyle.cssin you user config directory, visdom will serve the customized css file along with the default style-file.
In addition, it is also possible to create a project-specific file; just place the filestyle.cssin yourenv_path.Licensevisdom is Apache 2.0 licensed, as found in the LICENSE file.Note on Lua Torch SupportSupport for Lua Torch was deprecated followingv0.1.8.4. If you'd like to use torch support, you'll need to download that release. You can follow the usage instructions there, but it is no longer officially supported.ContributingSee guidelines for contributinghere.AcknowledgmentsVisdom was inspired by tools likedisplayand relies onPlotlyas a plotting front-end.