0

Given below is the code for plotting points using pyplot.

x1=300+p[k]*math.cos(val[thetaval])
y1=300+p[k]*math.sin(val[thetaval])
plt.plot(x1,y1,'k.')

The plotting is working fine, the problem is, if I want to plot it as a point I am specifying the dot in 'k.' inside the plot function. The output is something like:

enter image description here

The width of the black line/curve that I am plotting is much more that needed. How to reduce it?

2 Answers 2

2

It seems that you are not plotting a line but a series of small points. Maybe if you try setting the markersize argument of the plot function could work.

Sign up to request clarification or add additional context in comments.

Comments

0

Looking into the documentation of plot() you can find "linewidth"

So use:

plt.plot(x1,y1,'k.', linewidth=0.1)

4 Comments

I tried that already. The width is not decreasing. I also tried lw, still no change.
so what about using linewidth... they got an example: plot([1,2,3], [1,2,3], 'go-', label='line 1', linewidth=2) linewidth or lw = float value in points
Tried linewidth, no change. I referred the documentation. Is there anyway it is not working because I am plotting points and not a line?
Yes, try it. Also the linewidth = 0.5 , 1 , 0.01. Couldn't find the the interval for that and I cant test for you from this PC :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.