Skip to content

Commit 88289d7

Browse files
committed
Fix 'cycles' example
1 parent b6bd2e2 commit 88289d7

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

docs/cycles.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,8 @@
4848
# You can make your own color cycles using the `~proplot.constructor.Cycle`
4949
# constructor function.
5050

51-
# %%
52-
import numpy as np
53-
import pandas as pd
54-
55-
# %%
56-
# %%
5751
# %%
5852
import proplot as plot
59-
6053
fig, axs = plot.show_cycles()
6154

6255

@@ -76,6 +69,8 @@
7669
# `~proplot.constructor.Cycle` to the :rcraw:`axes.prop_cycle` setting (see
7770
# the :ref:`configuration guide <ug_config>`).
7871

72+
# %%
73+
import numpy as np
7974
lw = 5
8075
state = np.random.RandomState(51423)
8176
data = (state.rand(12, 6) - 0.45).cumsum(axis=0)
@@ -126,6 +121,9 @@
126121
# lines are referenced with colorbars and legends. Note that ProPlot allows
127122
# you to :ref:`generate colorbars from lists of lines <ug_cbars>`.
128123

124+
# %%
125+
import proplot as plot
126+
import numpy as np
129127
fig, axs = plot.subplots(ncols=2, share=0, axwidth=2.3)
130128
state = np.random.RandomState(51423)
131129
data = (20 * state.rand(10, 21) - 10).cumsum(axis=0)
@@ -160,6 +158,10 @@
160158
# constructed and applied to the axes locally. To apply it globally, simply
161159
# use ``plot.rc['axes.prop_cycle'] = cycle``.
162160

161+
# %%
162+
import proplot as plot
163+
import numpy as np
164+
import pandas as pd
163165

164166
# Create cycle that loops through 'dashes' Line2D property
165167
cycle = plot.Cycle(dashes=[(1, 0.5), (1, 1.5), (3, 0.5), (3, 1.5)])

0 commit comments

Comments
 (0)