Plot portfolio returns











up vote
-1
down vote

favorite












I have a numpy array with theese values:



A = [0,01
0,013
0,014
0,015
0,017
0,02]


Imagine that, each value is the return of a portfolio of stocks, and each values correspond to a differet date. My problem is that I would like to create a graph xy where on the x axis there are the dates and on the y axis there are the values of the array. Is it possible? thank you.










share|improve this question
























  • You cannot get a blank graph from this code. It will instead give you an error because kind = 'line' is not a valid argument to plt.plot. See Minimal, Complete, and Verifiable example.
    – ImportanceOfBeingErnest
    Nov 9 at 15:46










  • Thank you for the comment, unfortunately i can't replicate the entire code before the first line that I wrote, because there are xlsx files that I imported from my PC. To explain better my issue, I can say that I would like to obtain a line graph with in the x axes the dates and on the y axis the values of the matrix above. Is it possible to obtain this kind of graph? I am not a good user of the matplot package.
    – Davide Verardi
    Nov 9 at 18:12










  • Yes it's possible. But without a Minimal, Complete, and Verifiable example I cannot help further here. Good luck though.
    – ImportanceOfBeingErnest
    Nov 9 at 18:14










  • I edited the questions, I hope now is clearer than before.
    – Davide Verardi
    Nov 10 at 16:57










  • Did you read matplotlib.org/3.0.0/tutorials/introductory/…? How exactly does it not help you with your problem?
    – mkrieger1
    Nov 10 at 17:01















up vote
-1
down vote

favorite












I have a numpy array with theese values:



A = [0,01
0,013
0,014
0,015
0,017
0,02]


Imagine that, each value is the return of a portfolio of stocks, and each values correspond to a differet date. My problem is that I would like to create a graph xy where on the x axis there are the dates and on the y axis there are the values of the array. Is it possible? thank you.










share|improve this question
























  • You cannot get a blank graph from this code. It will instead give you an error because kind = 'line' is not a valid argument to plt.plot. See Minimal, Complete, and Verifiable example.
    – ImportanceOfBeingErnest
    Nov 9 at 15:46










  • Thank you for the comment, unfortunately i can't replicate the entire code before the first line that I wrote, because there are xlsx files that I imported from my PC. To explain better my issue, I can say that I would like to obtain a line graph with in the x axes the dates and on the y axis the values of the matrix above. Is it possible to obtain this kind of graph? I am not a good user of the matplot package.
    – Davide Verardi
    Nov 9 at 18:12










  • Yes it's possible. But without a Minimal, Complete, and Verifiable example I cannot help further here. Good luck though.
    – ImportanceOfBeingErnest
    Nov 9 at 18:14










  • I edited the questions, I hope now is clearer than before.
    – Davide Verardi
    Nov 10 at 16:57










  • Did you read matplotlib.org/3.0.0/tutorials/introductory/…? How exactly does it not help you with your problem?
    – mkrieger1
    Nov 10 at 17:01













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I have a numpy array with theese values:



A = [0,01
0,013
0,014
0,015
0,017
0,02]


Imagine that, each value is the return of a portfolio of stocks, and each values correspond to a differet date. My problem is that I would like to create a graph xy where on the x axis there are the dates and on the y axis there are the values of the array. Is it possible? thank you.










share|improve this question















I have a numpy array with theese values:



A = [0,01
0,013
0,014
0,015
0,017
0,02]


Imagine that, each value is the return of a portfolio of stocks, and each values correspond to a differet date. My problem is that I would like to create a graph xy where on the x axis there are the dates and on the y axis there are the values of the array. Is it possible? thank you.







python-3.x matplotlib plot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 16:56

























asked Nov 9 at 15:35









Davide Verardi

11




11












  • You cannot get a blank graph from this code. It will instead give you an error because kind = 'line' is not a valid argument to plt.plot. See Minimal, Complete, and Verifiable example.
    – ImportanceOfBeingErnest
    Nov 9 at 15:46










  • Thank you for the comment, unfortunately i can't replicate the entire code before the first line that I wrote, because there are xlsx files that I imported from my PC. To explain better my issue, I can say that I would like to obtain a line graph with in the x axes the dates and on the y axis the values of the matrix above. Is it possible to obtain this kind of graph? I am not a good user of the matplot package.
    – Davide Verardi
    Nov 9 at 18:12










  • Yes it's possible. But without a Minimal, Complete, and Verifiable example I cannot help further here. Good luck though.
    – ImportanceOfBeingErnest
    Nov 9 at 18:14










  • I edited the questions, I hope now is clearer than before.
    – Davide Verardi
    Nov 10 at 16:57










  • Did you read matplotlib.org/3.0.0/tutorials/introductory/…? How exactly does it not help you with your problem?
    – mkrieger1
    Nov 10 at 17:01


















  • You cannot get a blank graph from this code. It will instead give you an error because kind = 'line' is not a valid argument to plt.plot. See Minimal, Complete, and Verifiable example.
    – ImportanceOfBeingErnest
    Nov 9 at 15:46










  • Thank you for the comment, unfortunately i can't replicate the entire code before the first line that I wrote, because there are xlsx files that I imported from my PC. To explain better my issue, I can say that I would like to obtain a line graph with in the x axes the dates and on the y axis the values of the matrix above. Is it possible to obtain this kind of graph? I am not a good user of the matplot package.
    – Davide Verardi
    Nov 9 at 18:12










  • Yes it's possible. But without a Minimal, Complete, and Verifiable example I cannot help further here. Good luck though.
    – ImportanceOfBeingErnest
    Nov 9 at 18:14










  • I edited the questions, I hope now is clearer than before.
    – Davide Verardi
    Nov 10 at 16:57










  • Did you read matplotlib.org/3.0.0/tutorials/introductory/…? How exactly does it not help you with your problem?
    – mkrieger1
    Nov 10 at 17:01
















You cannot get a blank graph from this code. It will instead give you an error because kind = 'line' is not a valid argument to plt.plot. See Minimal, Complete, and Verifiable example.
– ImportanceOfBeingErnest
Nov 9 at 15:46




You cannot get a blank graph from this code. It will instead give you an error because kind = 'line' is not a valid argument to plt.plot. See Minimal, Complete, and Verifiable example.
– ImportanceOfBeingErnest
Nov 9 at 15:46












Thank you for the comment, unfortunately i can't replicate the entire code before the first line that I wrote, because there are xlsx files that I imported from my PC. To explain better my issue, I can say that I would like to obtain a line graph with in the x axes the dates and on the y axis the values of the matrix above. Is it possible to obtain this kind of graph? I am not a good user of the matplot package.
– Davide Verardi
Nov 9 at 18:12




Thank you for the comment, unfortunately i can't replicate the entire code before the first line that I wrote, because there are xlsx files that I imported from my PC. To explain better my issue, I can say that I would like to obtain a line graph with in the x axes the dates and on the y axis the values of the matrix above. Is it possible to obtain this kind of graph? I am not a good user of the matplot package.
– Davide Verardi
Nov 9 at 18:12












Yes it's possible. But without a Minimal, Complete, and Verifiable example I cannot help further here. Good luck though.
– ImportanceOfBeingErnest
Nov 9 at 18:14




Yes it's possible. But without a Minimal, Complete, and Verifiable example I cannot help further here. Good luck though.
– ImportanceOfBeingErnest
Nov 9 at 18:14












I edited the questions, I hope now is clearer than before.
– Davide Verardi
Nov 10 at 16:57




I edited the questions, I hope now is clearer than before.
– Davide Verardi
Nov 10 at 16:57












Did you read matplotlib.org/3.0.0/tutorials/introductory/…? How exactly does it not help you with your problem?
– mkrieger1
Nov 10 at 17:01




Did you read matplotlib.org/3.0.0/tutorials/introductory/…? How exactly does it not help you with your problem?
– mkrieger1
Nov 10 at 17:01

















active

oldest

votes











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',
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%2f53228766%2fplot-portfolio-returns%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2f53228766%2fplot-portfolio-returns%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







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini