Skip to content

fea: add new API to change plot generated by plotly#156

Open
machsix wants to merge 1 commit intogarrettj403:masterfrom
machsix:master
Open

fea: add new API to change plot generated by plotly#156
machsix wants to merge 1 commit intogarrettj403:masterfrom
machsix:master

Conversation

@machsix
Copy link
Copy Markdown

@machsix machsix commented Apr 13, 2026

Example

import numpy as np
from scienceplots.plotly import science
import plotly.graph_objects as go
science.apply()

def model(x, p):
    return x ** (2 * p + 1) / (1 + x ** (2 * p))
fig = go.Figure()
for p in [10, 15, 20, 30, 50, 100]:
    fig.add_trace(go.Scatter(x=x, y=model(x, p), mode='lines', name=f'{p}'))
fig.update_layout(title="Model Curves with Tecplot Style", xaxis_title="Voltage (mV)", yaxis_title=r"Current ($\mu$A)")
fig.show()
fig.write_html("test_science_template.html", include_plotlyjs="cdn")

…t science; science.apply()` to enable globally
@machsix machsix changed the title fea: add support to plotly style fea: add new API to change plot generated by plotly Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant