Skip to content

Contour plot of AEP #768

Answered by misi9170
Teddybear0227 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Teddybear0227, we don't have any inbuilt functionality for generating this kind of plot. However, I think you should be able to achieve what you want pretty quickly with matplotlib.pyplot.scatter.

Here's an example that could get you started:

import matplotlib.pyplot as plt
import numpy as np

x = np.array([1, 2, 3, 4, 1, 2, 3, 4])
y = np.array([0, 0, 0, 0, 1, 1, 1, 1])
aep = np.array([100, 90, 80, 70, 90, 80, 70, 60])

fig, ax = plt.subplots(1,1)
sc = ax.scatter(x, y, c=aep, cmap="cividis", vmin=50, vmax=110)
plt.colorbar(sc)

ax.set_xlim([0, 5])
ax.set_ylim([-0.5, 1.5])

plt.show()

which generates

In fact, you'll find some very similar code in example 29_floating_vs_fixedbottom_fa…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Teddybear0227
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants