-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Figure linewidth not documented and not visible when saved #9370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Uhmmm. I have no clue how that is working at all for you. It isn't
documented because I don't think any of the devs ever conceived that
feature...
…On Wed, Oct 11, 2017 at 11:37 AM, Ted Petrou ***@***.***> wrote:
Bug report
*Bug summary*
When creating a figure it is possible to use linewidth along with
edgecolor to create a border around the figure. The linewidth parameter
is not shown in the documentation
<https://matplotlib.org/api/_as_gen/matplotlib.pyplot.figure.html#matplotlib.pyplot.figure>.
There is no corresponding set_linewidth figure method.
Also, when saving to a file, this border is missing.
I am using Jupyter notebook.
*Code for reproduction*
fig = plt.figure(linewidth=20, edgecolor='r')
plt.plot([5,6])
plt.savefig('/Users/Ted/Desktop/figlw.png')
*Actual outcome*
[image: screen shot 2017-10-11 at 11 32 37 am]
<https://user-images.githubusercontent.com/7226751/31450707-1b68a7a6-ae78-11e7-83cb-e0d57d28abb2.png>
*Expected outcome*
*Matplotlib version*
- Operating system: OSX
- Matplotlib version: 2.1
- Matplotlib backend (module://ipykernel.pylab.backend_inline):
- Python version: 2.6
- Jupyter version (if applicable): 5.0
- Other libraries:
Updated through conda
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9370>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-AKdaRf5qieCcDHjBmAMX6mXk3Weks5srOC-gaJpZM4P1sMW>
.
|
I can confirm this as the behaviour. It is documented, at least on master in the Figure class: def __init__(self,
figsize=None, # defaults to rc figure.figsize
dpi=None, # defaults to rc figure.dpi
facecolor=None, # defaults to rc figure.facecolor
edgecolor=None, # defaults to rc figure.edgecolor
linewidth=0.0, # the default linewidth of the frame
frameon=None, # whether or not to draw the figure frame
subplotpars=None, # default to rc
tight_layout=None, # default to rc figure.autolayout
):
"""
*figsize*
w,h tuple in inches
*dpi*
Dots per inch
*facecolor*
The figure patch facecolor; defaults to rc ``figure.facecolor``
*edgecolor*
The figure patch edge color; defaults to rc ``figure.edgecolor``
*linewidth*
The figure patch edge linewidth; the default linewidth of the frame no idea why its not rendering when a png is saved... |
Ok,now I'm confused. I see it documented here at matplotlib.figure.Figure |
fwiw, only occurs in notebook inline backend, not notebook backend |
Huh... I stand corrected. I just never figured that was a thing. I learn
something new all the time.
If this is happening only in the inline backend, then this is a bug on
ipython/jupyter's part, not ours. They maintain that backend.
…On Wed, Oct 11, 2017 at 12:14 PM, Antony Lee ***@***.***> wrote:
fwiw, only occurs in notebook inline backend, not notebook backend
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9370 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-F4Txm4wiK827kIufRnDD8dWuKCgks5srOl-gaJpZM4P1sMW>
.
|
Well. It's still an issue for us because using e.g. qt5agg you get the same discrepancy. This is because the figure edgecolor is overridden by the But even setting savefig.edgecolor doesn't fix it for jupyter inline mode. Also I think the relevant setter method lives on |
I reproduced in |
I believe this is fixed by #15111. |
Bug report
Bug summary
When creating a figure it is possible to use
linewidth
along withedgecolor
to create a border around the figure. The linewidth parameter is not shown in the documentation. There is no correspondingset_linewidth
figure method.Also, when saving to a file, this border is missing.
I am using Jupyter notebook.
Code for reproduction
Actual outcome (in notebook)
Expected outcome
Matplotlib version
module://ipykernel.pylab.backend_inline
):Updated through conda
The text was updated successfully, but these errors were encountered: