PlotStyle Configuration Guide for Plotly

February 4, 2026 · View on GitHub

Available PlotStyle Parameters

ParameterTypeDefaultDescription
Figure Dimensions
widthint1200Figure width in pixels
heightint800Figure height in pixels
Rendering
renderer'SVG' / 'WebGL''SVG'Rendering backend
Trace Styling
line_widthfloat2.0Default line thickness for traces
line_stylestr'solid'Line style ('solid', 'dash', 'dot', 'dashdot')
opacity_mode'auto' / 'fixed''auto'Opacity calculation mode
fixed_opacityfloat0.8Opacity value when mode is 'fixed'
fill_opacityfloat0.3Opacity for filled areas
Layout and Spacing
margindict{'l': 80, 'r': 80, 't': 100, 'b': 80}Margins in pixels (left, right, top, bottom)
positions_paddingfloat0.025Padding between kmer position windows
Grid and Barriers
show_gridboolFalseShow background grid
grid_colorstr'rgba(128, 128, 128, 0.2)'Grid line color
zerolineboolFalseShow zero line on axes
barrier_stylestr'solid'Line style of position barrier lines ('solid', 'dash', 'dot', 'dashdot')
barrier_opacityfloat0.25Opacity of the barrier lines
barrier_colorstr'grey'Barrier line color
Axes
showlineboolTrueShow axis lines
linecolorstr'black'Axis line color
linewidthint1Axis line width
mirrorboolFalseMirror axis lines to opposite side
Background Colors
plot_bgcolorstr'white'Plot area background color
paper_bgcolorstr'white'Full figure background color
Colors and Themes
templatestr'plotly_white'Plotly built-in template
colorwaylist[str] / NoneNoneCustom color sequence override
Fonts
font_familystr'Arial, sans-serif'Default font family
title_font_sizeint20Main title font size
titlecolorstr'black'Title text color
axis_title_font_sizeint16Axis title font size
axis_title_colorstr'black'Axis title text color
tick_font_sizeint12Tick label font size
legend_font_sizeint12Legend text font size
annotation_font_sizeint11Annotation text font size
subplot_title_font_sizeint14Subplot title font size
Legend
show_legendboolTrueDisplay legend
legend_orientation'v' / 'h''v'Vertical or horizontal legend
legend_xfloat1.02Legend x position (0-1 scale)
legend_yfloat1Legend y position (0-1 scale)
legend_xanchorstr'left'X anchor point ('left', 'center', 'right')
legend_yanchorstr'top'Y anchor point ('top', 'middle', 'bottom')
legend_bgcolorstr'rgba(255, 255, 255, 0.8)'Legend background color
legend_bordercolorstr'rgba(0, 0, 0, 0.2)'Legend border color
legend_borderwidthint1Legend border width
Hover Interaction
hovermodestr'closest'Hover mode ('x', 'y', 'closest', 'x unified', 'y unified')
hoverlabel_bgcolorstr'white'Hover label background color
hoverlabel_bordercolorstr'black'Hover label border color
hoverlabel_font_sizeint12Hover label font size
Subplots
subplot_vertical_spacingfloat / NoneNoneVertical spacing between subplots (auto if None)
subplot_horizontal_spacingfloat / NoneNoneHorizontal spacing between subplots (auto if None)
Ticks
ticksstr'outside'Tick position ('outside', 'inside', '')
ticklenint5Tick length in pixels
tickwidthint1Tick line width
tickcolorstr'black'Tick color
Interactive Features
dragmodestr'zoom'Default drag interaction ('zoom', 'pan', 'select', 'lasso', 'orbit', 'turntable')
selectdirectionstr'd'Selection direction ('d'=diagonal, 'h'=horizontal, 'v'=vertical, 'any')
Export Configuration
toImageButtonOptionsdict{'format': 'png', 'width': 1200, 'height': 800, 'scale': 2}Image export settings

Example Usage

from currentview.utils.plotly_utils import PlotStyle

# Create a custom style
style = PlotStyle(
    width=1400,
    height=900,
    title_font_size=24,
    show_grid=True,
    hovermode='x unified',
    line_width=2.5,
    opacity_mode='fixed',
    fixed_opacity=0.7
)

# Use with CurrentView
from currentview import CurrentView

viz = CurrentView(
    K=9,
    signals_plot_style=style,
    stats_plot_style=style
)

Predefined Styles

Use PlotStyle.get_style() to access predefined configurations for different contexts. These can be used as a starting point and further customized.

from currentview.utils.plotly_utils import PlotStyle

# Get a predefined style by name
style = PlotStyle.get_style('presentation')

# Modify as needed
style.line_width = 3.5
style.show_grid = True

Available Style Names

Style NameDescriptionDimensionsPrimary Use Case
'paper_single'Single-column journal figure1050×700 (3.5"×2.33" at 300 DPI)Academic papers, single column
'paper_double'Two-column journal figure2100×1050 (7"×3.5" at 300 DPI)Academic papers, full width
`'poster'$\text{Conference} \text{poster} \text{figure}2400 \times 1800 (8" \times 6" \text{at} 300 \text{DPI})\text{Academic} \text{posters}
presentation'presentation'\text{Slide} \text{presentation} (\text{light})1920 \times 1080 (16:9)\text{Talks}, \text{lectures}
presentationdark'presentation_dark'\text{Dark} \text{theme} \text{presentation}1920 \times 1080 (16:9)\text{Talks} \text{in} \text{dimmed} \text{rooms}
interactive'interactive'\text{Web}/\text{exploration} (\text{light})1200 \times 800\text{Data} \text{exploration}, \text{notebooks}
interactivedark'interactive_dark'\text{Dark} \text{theme} \text{interactive}1200 \times 800\text{Dark}-\text{themed} \text{environments}

\text{Style} \text{Details}

$paper_single` - Optimized for single-column academic figures:

  • Compact margins for space efficiency
  • Smaller fonts sized for print readability
  • SVG export format preferred
  • Clean, minimal design

paper_double - Optimized for full-width academic figures:

  • 2:1 aspect ratio
  • Slightly larger fonts than single-column
  • More space for complex visualizations

poster - Optimized for conference posters:

  • Extra large fonts for distance viewing
  • Bold line widths (4.0)
  • High visual impact design
  • Arial Black font family

presentation - Optimized for slides:

  • 16:9 aspect ratio
  • Large fonts for back-of-room visibility
  • High contrast design
  • Mirrored axes for framing

presentation_dark - Dark variant for dimmed rooms:

  • Dark background (#0a0a0a)
  • Light text and grid lines
  • High contrast for projection

interactive - Optimized for exploration:

  • Standard screen dimensions
  • Auto opacity mode
  • Full zoom/pan interactivity
  • Detailed hover information

interactive_dark - Dark theme for notebooks/web:

  • Dark background
  • Reduced eye strain
  • Same interactivity as light version