Installation
Detailed installation instructions for all supported platforms.
Prerequisites
Section titled “Prerequisites”Before you begin, create a free account at app.gofigr.io/register.
Python
Section titled “Python”Requirements
Section titled “Requirements”- Python 3.8 or higher
- pip
Install via pip
Section titled “Install via pip”pip install gofigrThis installs both the client library and the IPython extension (compatible with Jupyter, VSCode, and others).
Configuration
Section titled “Configuration”After installation, run the gfconfig command-line tool:
gfconfigThis will prompt you for your credentials and save them to ~/.gofigr.
For advanced options (custom API URL, auto-publish settings, default metadata):
gfconfig --advancedJupyter Usage
Section titled “Jupyter Usage”The simplest way to use GoFigr in Jupyter is to load the extension:
%load_ext gofigrThat’s it! All figures you create will be automatically published.
For custom configuration:
%load_ext gofigr
from gofigr.jupyter import configure, FindByName
configure( workspace=FindByName("My Workspace"), analysis=FindByName("My Analysis", create=True), auto_publish=True)Script Usage
Section titled “Script Usage”For standalone Python scripts, use the Publisher class:
import matplotlib.pyplot as pltfrom gofigr.publisher import Publisher
pub = Publisher(workspace="My Workspace", analysis="Script Analysis")
plt.plot([1, 2, 3], [1, 4, 9])plt.title("My Plot")
pub.publish(plt.gcf())Environment Variables
Section titled “Environment Variables”Instead of using gfconfig, you can set environment variables:
| Variable | Description |
|---|---|
GF_USERNAME |
Your GoFigr username |
GF_PASSWORD |
Your GoFigr password |
GF_API_KEY |
Your API key (alternative to username/password) |
GF_WORKSPACE |
Workspace API ID |
GF_ANALYSIS |
Analysis API ID |
GF_URL |
API URL (default: https://api.gofigr.io) |
GF_AUTO_PUBLISH |
true or false |
Requirements
Section titled “Requirements”- R 4.0 or higher (tested with R 4.3.2)
Install from CRAN
Section titled “Install from CRAN”install.packages("gofigR")Install from GitHub (Development Version)
Section titled “Install from GitHub (Development Version)”For the latest development version:
library(devtools)devtools::install_github("gofigr/gofigR")Configuration
Section titled “Configuration”On the R prompt, load the package and run the configuration wizard:
library(gofigR)gfconfig()This will prompt you for your credentials and save them to ~/.gofigr.
R Markdown Usage
Section titled “R Markdown Usage”In your setup chunk, enable GoFigr:
```{r setup, include=FALSE}library(gofigR)gofigR::enable()```You can optionally specify an analysis name:
gofigR::enable(analysis_name = "My Analysis")Publishing Plots
Section titled “Publishing Plots”Use the publish() function to capture figures:
library(ggplot2)
# ggplot2p <- ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point()publish(p, "Weight vs MPG")
# Or with pipep %>% publish("Weight vs MPG")For base R graphics, wrap the plotting code:
publish({ plot(pressure, main = "Pressure vs Temperature") text(200, 50, "Note the non-linear relationship")}, figure_name = "Pressure Plot")Shiny Integration
Section titled “Shiny Integration”Replace plotOutput + renderPlot with gfPlot + gfPlotServer:
library(shiny)library(gofigR)
gofigR::enable()
ui <- fluidPage( titlePanel("My App"), mainPanel( gfPlot("myPlot") ))
server <- function(input, output) { gfPlotServer("myPlot", { hist(faithful$eruptions, main = "Eruption Duration") }, input, figure_name = "Faithful Histogram")}
shinyApp(ui = ui, server = server)Configuration File
Section titled “Configuration File”Both Python and R store configuration in ~/.gofigr. This file is created automatically by the gfconfig command/function.
Troubleshooting
Section titled “Troubleshooting”Authentication Errors
Section titled “Authentication Errors”If you get authentication errors:
- Run
gfconfigagain to update your credentials - Check that your API key is valid in the GoFigr web app
- Verify environment variables if using them
Connection Issues
Section titled “Connection Issues”- Verify you can reach
https://api.gofigr.io - Check firewall settings if on a corporate network
- For enterprise installations, ensure
GF_URLis set correctly
For more help, visit gofigr.io/support.