What is a good, default backend for matplotlib
I've decided to setup a custom matplotlibrc
, and thus I need to pick a backend for matplotlib
. What is the best one in terms of not needing to install other additional packages?
I tend to use matplotlib
via ipython --pylab
, so I want interactive window based plots (when I don't I can switch to Agg
).
I've tried WXAgg
, but this requires (sensibly enough) WX.
python matplotlib plot
add a comment |
I've decided to setup a custom matplotlibrc
, and thus I need to pick a backend for matplotlib
. What is the best one in terms of not needing to install other additional packages?
I tend to use matplotlib
via ipython --pylab
, so I want interactive window based plots (when I don't I can switch to Agg
).
I've tried WXAgg
, but this requires (sensibly enough) WX.
python matplotlib plot
add a comment |
I've decided to setup a custom matplotlibrc
, and thus I need to pick a backend for matplotlib
. What is the best one in terms of not needing to install other additional packages?
I tend to use matplotlib
via ipython --pylab
, so I want interactive window based plots (when I don't I can switch to Agg
).
I've tried WXAgg
, but this requires (sensibly enough) WX.
python matplotlib plot
I've decided to setup a custom matplotlibrc
, and thus I need to pick a backend for matplotlib
. What is the best one in terms of not needing to install other additional packages?
I tend to use matplotlib
via ipython --pylab
, so I want interactive window based plots (when I don't I can switch to Agg
).
I've tried WXAgg
, but this requires (sensibly enough) WX.
python matplotlib plot
python matplotlib plot
edited Dec 9 '18 at 8:55
karel
58.6k13128147
58.6k13128147
asked Jun 11 '18 at 20:40
DaveDave
166110
166110
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Both Agg
and TkAgg
do not require any dependencies beyond Python's standard library.
I have had some issues with TkAgg
and multi-threading, so if you only need to save to files (and not plt.show()
), I would recommend using Agg
instead (just replace it where TkAgg
appears below).
Either add the following line to your ~/.config/matplotlib/matplotlibrc
:
backend: TkAgg
Or the following lines to your python file:
import matplotlib
matplotlib.use('TkAgg') # MUST BE CALLED BEFORE IMPORTING plt
import matplotlib.pyplot as plt
add a comment |
I prefer inline plots with matplotlib to plots in a separate window because it makes it easier to see what I'm doing when I'm fine tuning the Python code.
Python IDE for scientists (spyder) can do inline plotting. To try out this feature open the terminal and type:
sudo apt install python2.7 python-matplotlib spyder ipython
After the ipython prompt in the IPython console copy/paste the below code and press the Enter key to run it.
import matplotlib.pyplot as plt
x, y = [-1, 12], [1, 4]
plt.plot(x, y, marker = 'o')
Atom text editor with the Hydrogen package for Atom installed can also do inline plotting. I find the Atom interface more complicated to configure than Spyder in which inline plotting with matplotlib works out of the box. I got started with inline plotting in Atom because I wanted to use Atom to make inline plots with other programming languages too.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1045720%2fwhat-is-a-good-default-backend-for-matplotlib%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Both Agg
and TkAgg
do not require any dependencies beyond Python's standard library.
I have had some issues with TkAgg
and multi-threading, so if you only need to save to files (and not plt.show()
), I would recommend using Agg
instead (just replace it where TkAgg
appears below).
Either add the following line to your ~/.config/matplotlib/matplotlibrc
:
backend: TkAgg
Or the following lines to your python file:
import matplotlib
matplotlib.use('TkAgg') # MUST BE CALLED BEFORE IMPORTING plt
import matplotlib.pyplot as plt
add a comment |
Both Agg
and TkAgg
do not require any dependencies beyond Python's standard library.
I have had some issues with TkAgg
and multi-threading, so if you only need to save to files (and not plt.show()
), I would recommend using Agg
instead (just replace it where TkAgg
appears below).
Either add the following line to your ~/.config/matplotlib/matplotlibrc
:
backend: TkAgg
Or the following lines to your python file:
import matplotlib
matplotlib.use('TkAgg') # MUST BE CALLED BEFORE IMPORTING plt
import matplotlib.pyplot as plt
add a comment |
Both Agg
and TkAgg
do not require any dependencies beyond Python's standard library.
I have had some issues with TkAgg
and multi-threading, so if you only need to save to files (and not plt.show()
), I would recommend using Agg
instead (just replace it where TkAgg
appears below).
Either add the following line to your ~/.config/matplotlib/matplotlibrc
:
backend: TkAgg
Or the following lines to your python file:
import matplotlib
matplotlib.use('TkAgg') # MUST BE CALLED BEFORE IMPORTING plt
import matplotlib.pyplot as plt
Both Agg
and TkAgg
do not require any dependencies beyond Python's standard library.
I have had some issues with TkAgg
and multi-threading, so if you only need to save to files (and not plt.show()
), I would recommend using Agg
instead (just replace it where TkAgg
appears below).
Either add the following line to your ~/.config/matplotlib/matplotlibrc
:
backend: TkAgg
Or the following lines to your python file:
import matplotlib
matplotlib.use('TkAgg') # MUST BE CALLED BEFORE IMPORTING plt
import matplotlib.pyplot as plt
edited Jan 22 at 17:00
answered Aug 30 '18 at 1:57
matwilsomatwilso
1415
1415
add a comment |
add a comment |
I prefer inline plots with matplotlib to plots in a separate window because it makes it easier to see what I'm doing when I'm fine tuning the Python code.
Python IDE for scientists (spyder) can do inline plotting. To try out this feature open the terminal and type:
sudo apt install python2.7 python-matplotlib spyder ipython
After the ipython prompt in the IPython console copy/paste the below code and press the Enter key to run it.
import matplotlib.pyplot as plt
x, y = [-1, 12], [1, 4]
plt.plot(x, y, marker = 'o')
Atom text editor with the Hydrogen package for Atom installed can also do inline plotting. I find the Atom interface more complicated to configure than Spyder in which inline plotting with matplotlib works out of the box. I got started with inline plotting in Atom because I wanted to use Atom to make inline plots with other programming languages too.
add a comment |
I prefer inline plots with matplotlib to plots in a separate window because it makes it easier to see what I'm doing when I'm fine tuning the Python code.
Python IDE for scientists (spyder) can do inline plotting. To try out this feature open the terminal and type:
sudo apt install python2.7 python-matplotlib spyder ipython
After the ipython prompt in the IPython console copy/paste the below code and press the Enter key to run it.
import matplotlib.pyplot as plt
x, y = [-1, 12], [1, 4]
plt.plot(x, y, marker = 'o')
Atom text editor with the Hydrogen package for Atom installed can also do inline plotting. I find the Atom interface more complicated to configure than Spyder in which inline plotting with matplotlib works out of the box. I got started with inline plotting in Atom because I wanted to use Atom to make inline plots with other programming languages too.
add a comment |
I prefer inline plots with matplotlib to plots in a separate window because it makes it easier to see what I'm doing when I'm fine tuning the Python code.
Python IDE for scientists (spyder) can do inline plotting. To try out this feature open the terminal and type:
sudo apt install python2.7 python-matplotlib spyder ipython
After the ipython prompt in the IPython console copy/paste the below code and press the Enter key to run it.
import matplotlib.pyplot as plt
x, y = [-1, 12], [1, 4]
plt.plot(x, y, marker = 'o')
Atom text editor with the Hydrogen package for Atom installed can also do inline plotting. I find the Atom interface more complicated to configure than Spyder in which inline plotting with matplotlib works out of the box. I got started with inline plotting in Atom because I wanted to use Atom to make inline plots with other programming languages too.
I prefer inline plots with matplotlib to plots in a separate window because it makes it easier to see what I'm doing when I'm fine tuning the Python code.
Python IDE for scientists (spyder) can do inline plotting. To try out this feature open the terminal and type:
sudo apt install python2.7 python-matplotlib spyder ipython
After the ipython prompt in the IPython console copy/paste the below code and press the Enter key to run it.
import matplotlib.pyplot as plt
x, y = [-1, 12], [1, 4]
plt.plot(x, y, marker = 'o')
Atom text editor with the Hydrogen package for Atom installed can also do inline plotting. I find the Atom interface more complicated to configure than Spyder in which inline plotting with matplotlib works out of the box. I got started with inline plotting in Atom because I wanted to use Atom to make inline plots with other programming languages too.
edited Jan 10 at 16:40
answered Nov 13 '18 at 16:02
karelkarel
58.6k13128147
58.6k13128147
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- 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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1045720%2fwhat-is-a-good-default-backend-for-matplotlib%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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