question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: pplt.rc.load does not work properly

See original GitHub issue

Description

pplt.rc.load does not work properly. I found the problem when I was playing with ~/.proplotrc. The same problem appears as in the following example.

Steps to reproduce

I save a rc file as follows

import proplot as pplt

pplt.rc['font.size'] = 10
pplt.rc['axes.labelsize'] = 'med-large'
pplt.rc.save('proplotrc', comment=True, backup=False, description=True)
pplt.rc['font.size'],pplt.rc['axes.labelsize'], pplt.rc['label.size']

It prints (10.0, 'med-large', 'med-large')

The file is indeed updated with the lines

# Changed settings
label.size:     med-large
axes.labelsize: med-large
font.size:      10.0

Then I restart the session and load the same file as follows

import proplot as pplt
pplt.rc.load('proplotrc')
pplt.rc['font.size'],pplt.rc['axes.labelsize'], pplt.rc['label.size']

It prints (10.000000000000002, 'medium', 'medium').

Proplot version

Paste the results of import matplotlib; print(matplotlib.__version__); import proplot; print(proplot.version)here. 3.4.3 0.9.5.post259

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
lukelbdcommented, Jan 30, 2022

This is fixed by 6ea48d5. The issue was that in the proplotrc file, font.size came after label.size. The internal implementation of _load_file caused the font.size setting to overwrite your label.size with the default value.

Now your example

import proplot as pplt
pplt.rc.load('proplotrc')
pplt.rc['font.size'],pplt.rc['axes.labelsize'], pplt.rc['label.size']

correctly prints (10.000000000000002, 'med-large', 'med-large').

0reactions
syrtecommented, Jan 30, 2022

Many thanks for the quick fix!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Matplotlib RC Parameters not working correctly
Somehow plt.rcParams['axes.labelweight'] = 'bold is not working, but at least the fontsize is now correct. – Camill Trüeb.
Read more >
[Bug]: tight_layout (version 3.5+) · Issue #22673 - GitHub
Bug summary fig.tight_layout is broken in current matplotlib. ... If I use plt.ion() , I cannot reproduce your problem on MacOS.
Read more >
What's new? — ProPlot documentation
What's new?¶. This page lists the API changes with each version. Please note that when functions and keywords are renamed, they are not...
Read more >
Matplotlib 3.6.2 documentation
An object-oriented plotting library. A procedural interface is provided by the companion pyplot module, which may be imported directly, e.g.: import matplotlib ...
Read more >
Matplotlib - Introduction to Python Plots with Examples | ML+
So how to draw a scatterplot instead? Well to do that, let's understand a bit more about what arguments plt.plot() expects.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found