Skip to content
Snippets Groups Projects
Commit f564a9d5 authored by Kostas Vilkelis's avatar Kostas Vilkelis :flamingo:
Browse files

fix figure

parent e10401db
Branches lecture_14
No related tags found
1 merge request!107Write up np junctions
Pipeline #59811 passed
......@@ -212,6 +212,7 @@ Let us build up the band diagram step by step:
```python
def trans(x, a, b):
x = (x-a)/(b-a)
return h(x)/(h(x) + h(1-x))
......@@ -343,7 +344,62 @@ fig1.add_trace(go.Scatter(
showlegend=False
))
annot = [dict(
base_annot = [
dict(
x = 1.065,
y = -0.1,
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "",
ax = 0.9,
ay = -0.1,
showarrow=True,
arrowhead=3,
arrowsize=30,
arrowwidth=0.1,
arrowcolor='black'),
dict(
x = -0.05,
y = 1.12,
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "",
ax = -0.05,
ay = 1.1,
showarrow=True,
arrowhead=3,
arrowsize=30,
arrowwidth=0.1,
arrowcolor='black'),
dict(
showarrow=False,
x = 0.15,
y = -0.05,
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "p-region"),
dict(
showarrow=False,
x = 0.5,
y = -0.05,
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "depletion region"),
dict(
showarrow=False,
x = 0.85,
y = -0.05,
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "n-region")
]
annot = [
dict(
x = 0.85,
y = 0.75,
xref = "x", yref = "y",
......@@ -376,7 +432,9 @@ annot = [dict(
axref = "x", ayref = "y",
text = r'$\varphi$',
font = dict(size=40),
showarrow=False)
showarrow=False),
*base_annot
]
......@@ -390,10 +448,10 @@ updatemenus=list([
buttons=list([
dict(label="n and p",
method="update",
args=[{"visible": [True, True, True, True, True, True, False, False, False, False, False]}, {'annotations':[]}]),
args=[{"visible": [True, True, True, True, True, True, False, False, False, False, False]}, {'annotations':base_annot}]),
dict(label="Equilibrium",
method="update",
args=[{"visible": [True, True, False, False, False, False, True, True, True, False, False]}, {'annotations':annot }]),
args=[{"visible": [True, True, False, False, False, False, True, True, True, False, False]}, {'annotations':annot}]),
dict(label="Band Bending",
method="update",
args=[{"visible": [True, True, False, False, False, False, True, True, True, True, True]}, {'annotations':annot}]),
......@@ -416,8 +474,6 @@ layout = dict(
title='Band Diagram'
)
fig1.update_xaxes(showline=True, linewidth=2, linecolor='black')
fig1.update_yaxes(showline=True, linewidth=2, linecolor='black')
fig1.add_annotation(
x = 1.065,
......@@ -432,22 +488,7 @@ fig1.add_annotation(
arrowsize=30,
arrowwidth=0.1,
arrowcolor='black')
fig1.add_annotation(
x = -0.05,
y = 1.12,
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "",
ax = -0.05,
ay = 1.1,
showarrow=True,
arrowhead=3,
arrowsize=30,
arrowwidth=0.1,
arrowcolor='black')
fig1.add_annotation(
x = -0.05,
y = 1.12,
......@@ -461,7 +502,7 @@ fig1.add_annotation(
arrowsize=30,
arrowwidth=0.1,
arrowcolor='black')
fig1.add_annotation(
showarrow=False,
x = 0.15,
......@@ -469,7 +510,7 @@ fig1.add_annotation(
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "p-region")
fig1.add_annotation(
showarrow=False,
x = 0.5,
......@@ -477,14 +518,22 @@ fig1.add_annotation(
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "depletion region")
fig1.add_annotation(
showarrow=False,
x = 0.85,
y = -0.05,
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "n-region")
text = "n-region")
fig1.update_xaxes(showline=True, linewidth=2, linecolor='black')
fig1.update_yaxes(showline=True, linewidth=2, linecolor='black')
fig1.update_layout(layout)
py.plot(fig1)
fig1.show()
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment