Skip to content

Instantly share code, notes, and snippets.

@vitvakatu
Created November 15, 2017 07:12
Show Gist options
  • Save vitvakatu/53c471e9d0a33907a5d076f3f669a723 to your computer and use it in GitHub Desktop.
Save vitvakatu/53c471e9d0a33907a5d076f3f669a723 to your computer and use it in GitHub Desktop.
import plotly
from plotly.graph_objs import Scatter, Layout
trace1 = Scatter(
x = [0, 0.06, 0.0715],
y = [236, 38, 0],
name = 'n(M)',
line = dict(
shape = 'linear',
width = 3,
),
)
trace2 = Scatter(
x = [0, 0.08],
y = [1, 2],
name = 'I(M)',
yaxis = 'y2',
line = dict(
dash = 'dash',
width = 3,
),
)
data = [trace1, trace2]
layout = Layout(
title = 'Регулировочная и механическая хар-ки',
xaxis = dict(
title = 'M, Н⋅м',
),
yaxis = dict(
title = 'n, об/мин'
),
yaxis2 = dict(
title = 'I, А',
overlaying = 'y',
side = 'right',
anchor = 'y',
),
)
plotly.offline.plot({
"data": data,
"layout": layout
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment