Plot-style of matplotlib

Multi tool use
Multi tool use





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I'd like to know why matplotlib outputs plots in different styles depending on which system I run the file. For example, I let the same code run twice, once on a Windows machine and once on Ubuntu system, and got the following two plots



Windows versionUbuntu version
The information in the plots is obviously the same, but is there a special command to let matplotlib know that I'd, for example, would like all my plots to be produced in the "Ubuntu style" (lower of the two) version?










share|improve this question

























  • It's to do with the backend that is used - it's different by default for Windows and Unix. matplotlib.org/faq/usage_faq.html#what-is-a-backend You can set it like this: backend : WXAgg

    – Ben Jones
    Nov 16 '18 at 13:05








  • 1





    You have two different versions of matplotlib installed on both systems. Check the version via print(matplotlib.__version__). Obviously you can install the same version on all your computers and get the same output. I don't know which of the two plots you call "Ubuntu style", which would be important to know for alternative solutions.

    – ImportanceOfBeingErnest
    Nov 16 '18 at 13:08











  • It has nothing to do with the backend though, as claimed by the other comment.

    – ImportanceOfBeingErnest
    Nov 16 '18 at 13:09











  • @ImportanceOfBeingErnest Thanks for the info, I edited the question. Would still be nice to know how I could change it to the other version withou having to install different versions.

    – Sito
    Nov 16 '18 at 13:11











  • Ah yes you're right @ImportanceOfBeingErnest

    – Ben Jones
    Nov 16 '18 at 13:27


















0















I'd like to know why matplotlib outputs plots in different styles depending on which system I run the file. For example, I let the same code run twice, once on a Windows machine and once on Ubuntu system, and got the following two plots



Windows versionUbuntu version
The information in the plots is obviously the same, but is there a special command to let matplotlib know that I'd, for example, would like all my plots to be produced in the "Ubuntu style" (lower of the two) version?










share|improve this question

























  • It's to do with the backend that is used - it's different by default for Windows and Unix. matplotlib.org/faq/usage_faq.html#what-is-a-backend You can set it like this: backend : WXAgg

    – Ben Jones
    Nov 16 '18 at 13:05








  • 1





    You have two different versions of matplotlib installed on both systems. Check the version via print(matplotlib.__version__). Obviously you can install the same version on all your computers and get the same output. I don't know which of the two plots you call "Ubuntu style", which would be important to know for alternative solutions.

    – ImportanceOfBeingErnest
    Nov 16 '18 at 13:08











  • It has nothing to do with the backend though, as claimed by the other comment.

    – ImportanceOfBeingErnest
    Nov 16 '18 at 13:09











  • @ImportanceOfBeingErnest Thanks for the info, I edited the question. Would still be nice to know how I could change it to the other version withou having to install different versions.

    – Sito
    Nov 16 '18 at 13:11











  • Ah yes you're right @ImportanceOfBeingErnest

    – Ben Jones
    Nov 16 '18 at 13:27














0












0








0








I'd like to know why matplotlib outputs plots in different styles depending on which system I run the file. For example, I let the same code run twice, once on a Windows machine and once on Ubuntu system, and got the following two plots



Windows versionUbuntu version
The information in the plots is obviously the same, but is there a special command to let matplotlib know that I'd, for example, would like all my plots to be produced in the "Ubuntu style" (lower of the two) version?










share|improve this question
















I'd like to know why matplotlib outputs plots in different styles depending on which system I run the file. For example, I let the same code run twice, once on a Windows machine and once on Ubuntu system, and got the following two plots



Windows versionUbuntu version
The information in the plots is obviously the same, but is there a special command to let matplotlib know that I'd, for example, would like all my plots to be produced in the "Ubuntu style" (lower of the two) version?







python python-3.x matplotlib plot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 13:09







Sito

















asked Nov 16 '18 at 13:02









SitoSito

192313




192313













  • It's to do with the backend that is used - it's different by default for Windows and Unix. matplotlib.org/faq/usage_faq.html#what-is-a-backend You can set it like this: backend : WXAgg

    – Ben Jones
    Nov 16 '18 at 13:05








  • 1





    You have two different versions of matplotlib installed on both systems. Check the version via print(matplotlib.__version__). Obviously you can install the same version on all your computers and get the same output. I don't know which of the two plots you call "Ubuntu style", which would be important to know for alternative solutions.

    – ImportanceOfBeingErnest
    Nov 16 '18 at 13:08











  • It has nothing to do with the backend though, as claimed by the other comment.

    – ImportanceOfBeingErnest
    Nov 16 '18 at 13:09











  • @ImportanceOfBeingErnest Thanks for the info, I edited the question. Would still be nice to know how I could change it to the other version withou having to install different versions.

    – Sito
    Nov 16 '18 at 13:11











  • Ah yes you're right @ImportanceOfBeingErnest

    – Ben Jones
    Nov 16 '18 at 13:27



















  • It's to do with the backend that is used - it's different by default for Windows and Unix. matplotlib.org/faq/usage_faq.html#what-is-a-backend You can set it like this: backend : WXAgg

    – Ben Jones
    Nov 16 '18 at 13:05








  • 1





    You have two different versions of matplotlib installed on both systems. Check the version via print(matplotlib.__version__). Obviously you can install the same version on all your computers and get the same output. I don't know which of the two plots you call "Ubuntu style", which would be important to know for alternative solutions.

    – ImportanceOfBeingErnest
    Nov 16 '18 at 13:08











  • It has nothing to do with the backend though, as claimed by the other comment.

    – ImportanceOfBeingErnest
    Nov 16 '18 at 13:09











  • @ImportanceOfBeingErnest Thanks for the info, I edited the question. Would still be nice to know how I could change it to the other version withou having to install different versions.

    – Sito
    Nov 16 '18 at 13:11











  • Ah yes you're right @ImportanceOfBeingErnest

    – Ben Jones
    Nov 16 '18 at 13:27

















It's to do with the backend that is used - it's different by default for Windows and Unix. matplotlib.org/faq/usage_faq.html#what-is-a-backend You can set it like this: backend : WXAgg

– Ben Jones
Nov 16 '18 at 13:05







It's to do with the backend that is used - it's different by default for Windows and Unix. matplotlib.org/faq/usage_faq.html#what-is-a-backend You can set it like this: backend : WXAgg

– Ben Jones
Nov 16 '18 at 13:05






1




1





You have two different versions of matplotlib installed on both systems. Check the version via print(matplotlib.__version__). Obviously you can install the same version on all your computers and get the same output. I don't know which of the two plots you call "Ubuntu style", which would be important to know for alternative solutions.

– ImportanceOfBeingErnest
Nov 16 '18 at 13:08





You have two different versions of matplotlib installed on both systems. Check the version via print(matplotlib.__version__). Obviously you can install the same version on all your computers and get the same output. I don't know which of the two plots you call "Ubuntu style", which would be important to know for alternative solutions.

– ImportanceOfBeingErnest
Nov 16 '18 at 13:08













It has nothing to do with the backend though, as claimed by the other comment.

– ImportanceOfBeingErnest
Nov 16 '18 at 13:09





It has nothing to do with the backend though, as claimed by the other comment.

– ImportanceOfBeingErnest
Nov 16 '18 at 13:09













@ImportanceOfBeingErnest Thanks for the info, I edited the question. Would still be nice to know how I could change it to the other version withou having to install different versions.

– Sito
Nov 16 '18 at 13:11





@ImportanceOfBeingErnest Thanks for the info, I edited the question. Would still be nice to know how I could change it to the other version withou having to install different versions.

– Sito
Nov 16 '18 at 13:11













Ah yes you're right @ImportanceOfBeingErnest

– Ben Jones
Nov 16 '18 at 13:27





Ah yes you're right @ImportanceOfBeingErnest

– Ben Jones
Nov 16 '18 at 13:27












1 Answer
1






active

oldest

votes


















2














The upper plot is produced with a version of matplotlib >= 2.0. The lower plot is produced with a version < 2.0. The style changes are documented in the Changes to the default style.



It's hardly possible to make a matplotlib version < 2.0 produce the exact output you'd get with matplotlib >= 2.0, although you might copy the style sheet from a newer version to the old one and set the parameters accordingly.



The inverse is however possible. To get the old (classic) style in a new version of matplotlib should be possible via



import matplotlib.pyplot as plt
plt.style.use("classic")





share|improve this answer
























  • Works perfectly, thanks!

    – Sito
    Nov 16 '18 at 13:28












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53338458%2fplot-style-of-matplotlib%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














The upper plot is produced with a version of matplotlib >= 2.0. The lower plot is produced with a version < 2.0. The style changes are documented in the Changes to the default style.



It's hardly possible to make a matplotlib version < 2.0 produce the exact output you'd get with matplotlib >= 2.0, although you might copy the style sheet from a newer version to the old one and set the parameters accordingly.



The inverse is however possible. To get the old (classic) style in a new version of matplotlib should be possible via



import matplotlib.pyplot as plt
plt.style.use("classic")





share|improve this answer
























  • Works perfectly, thanks!

    – Sito
    Nov 16 '18 at 13:28
















2














The upper plot is produced with a version of matplotlib >= 2.0. The lower plot is produced with a version < 2.0. The style changes are documented in the Changes to the default style.



It's hardly possible to make a matplotlib version < 2.0 produce the exact output you'd get with matplotlib >= 2.0, although you might copy the style sheet from a newer version to the old one and set the parameters accordingly.



The inverse is however possible. To get the old (classic) style in a new version of matplotlib should be possible via



import matplotlib.pyplot as plt
plt.style.use("classic")





share|improve this answer
























  • Works perfectly, thanks!

    – Sito
    Nov 16 '18 at 13:28














2












2








2







The upper plot is produced with a version of matplotlib >= 2.0. The lower plot is produced with a version < 2.0. The style changes are documented in the Changes to the default style.



It's hardly possible to make a matplotlib version < 2.0 produce the exact output you'd get with matplotlib >= 2.0, although you might copy the style sheet from a newer version to the old one and set the parameters accordingly.



The inverse is however possible. To get the old (classic) style in a new version of matplotlib should be possible via



import matplotlib.pyplot as plt
plt.style.use("classic")





share|improve this answer













The upper plot is produced with a version of matplotlib >= 2.0. The lower plot is produced with a version < 2.0. The style changes are documented in the Changes to the default style.



It's hardly possible to make a matplotlib version < 2.0 produce the exact output you'd get with matplotlib >= 2.0, although you might copy the style sheet from a newer version to the old one and set the parameters accordingly.



The inverse is however possible. To get the old (classic) style in a new version of matplotlib should be possible via



import matplotlib.pyplot as plt
plt.style.use("classic")






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 16 '18 at 13:19









ImportanceOfBeingErnestImportanceOfBeingErnest

141k13166243




141k13166243













  • Works perfectly, thanks!

    – Sito
    Nov 16 '18 at 13:28



















  • Works perfectly, thanks!

    – Sito
    Nov 16 '18 at 13:28

















Works perfectly, thanks!

– Sito
Nov 16 '18 at 13:28





Works perfectly, thanks!

– Sito
Nov 16 '18 at 13:28




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53338458%2fplot-style-of-matplotlib%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







5 b,b,n2B1pc qnl5aj iG2 iF3d8vj8hlUHQDnDemyrA7B
XhLmIsk4VY9z,BP5lBW7f RVw32K1Tkjg6vUOdw9j8k wRCj pN8KrG KA3,dOzB8dbNfzKkVIlfTqqI,YPq 1,of3TzK9d

Popular posts from this blog

Bressuire

Vorschmack

Xamarin.iOS Cant Deploy on Iphone