What are the units for linewidths parameter?

When calling:

    ax.contour(image, np.arange(0, 255, 8), colors='red', linewidths=0.1)

I get:

Screenshot from 2022-07-10 23-17-57

Increasing the line width 10x from 0.1 to 10, I get:

Screenshot from 2022-07-10 23-18-21

which is not 10x thicker [in pixels]. What are the units used for linewidths parameter? Is it described somewhere in the documentation?

Comments in this page:
https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.linewidth#a-sample-matplotlibrc-file

suggest that it is in points (not pixels, the printer’s measure, 1/72
inch IIRC).

Cheers,
Cameron Simpson cs@cskk.id.au

···

On 11Jul2022 05:32, Paul Jurczak via Matplotlib nobody@discourse.matplotlib.org wrote:

When calling:

   ax.contour(image, np.arange(0, 255, 8), colors='red', linewidths=0.1)

I get:

Screenshot from 2022-07-10 23-17-57

Increasing the line width 10x from 0.1 to 10, I get:

Screenshot from 2022-07-10 23-18-21

which is not 10x thicker [in pixels]. What are the units used for
linewidths parameter? Is it described somewhere in the documentation?

2 Likes

It looks as if there’s a bit of a typo in your question:

Increasing the line width 10x from 0.1 to 10, I get:

Which is not a 10x difference. (@cameron’s answer is correct).

1 Like

Yes, of course. I meant “from 0.1 to 1”. I don’t see question edit option. Perhaps it disappears after the first answer is posted.

Maybe. Or simply after a period of time. Certainly (as an email user) I
prefer to see corrections bigger than fixing spelling appear as a
distinct post.

Cheers,
Cameron Simpson cs@cskk.id.au

···

On 18Jul2022 20:05, Paul Jurczak via Matplotlib nobody@discourse.matplotlib.org wrote:

Yes, of course. I meant “from 0.1 to 1”. I don’t see question edit
option. Perhaps it disappears after the first answer is posted.