-1

I have a wind farm simulated by a LES model. Now, I have the positions of the turbines I than use:

plt.plot(xrow,y_position,'w|',markersize=8)

With xrow and y_position are the locations of the turbines. Let's say for a 128,512 grid they are at:

xrow = [250,250,250,250]
y_poistion = [26,51,77,102]

I then use the code line I showed before but it Gives me only marker styles like this: | . And when I increase the marker size.

markersize = 12

It only Increases the length of the "bar" and not the thickness. Now I would like to find out how to plot fat bars if you only have one data point available, xrow and y_position.

Here's an example code:

import matplotlib.pyplot as plt
import numpy as np
xy=np.zeros((128,512))
x = range(512)
y = range(128)
for i in y:
    for j in x:
        xy[i][j]=i*j
plt.imshow(xy, cmap = 'hot')
xrow = [250,250,250,250]
y_position = [26,51,77,102]
plt.plot(xrow,y_position,'w|',markersize=8, linewidth = 2)
plt.show()

This should give a plot with 4 white lines at a certain position. My question is, how do I widen these lines?

Please, help me with this.

Coha
  • 23
  • 6
  • I don't think this in anywhere near enough information to answer your question. You'll need to provide a complete code sample, as well as a description of current and expected behaviours. – robinsax Dec 06 '19 at 08:32
  • just use `linewidth` parameter in plot – Clément Dec 06 '19 at 08:33
  • @robinsax Okay thank you. However, I don't think I'm allowed to share the data. So It's hard to send the figures with it. – Coha Dec 06 '19 at 08:35
  • @Clément The linewidth parameter doesn't work with markers – Coha Dec 06 '19 at 08:36
  • 1
    In general, a good approach when encountering a bug is to write the simplest piece of code possible to trigger the bug (not relying on real data, for example), then if you don't identify the problem by doing that, share that code here (it'll be reproducible and much easier for people to help you with). – robinsax Dec 06 '19 at 08:39
  • I believe you’re looking for the `quiver` plot. Have a look [here](https://stackoverflow.com/a/37155755/2476444). – Oliver W. Dec 06 '19 at 09:02

1 Answers1

1

You can set the marker line width with markeredgewidth or abbreviated mew:

plt.plot(xrow, y_position, 'w|', markersize=8, mew=4)
JE_Muc
  • 5,403
  • 2
  • 26
  • 41
  • You are welcome and may also accept/upvote my answer, if it helped you. This will also give you some points. – JE_Muc Dec 06 '19 at 09:32