|
From: Wayne W. <sie...@sb...> - 2010-02-14 02:04:03
|
Suppose I plot a line from (0,0) to (1,1.5) to (2,2). Now I want to mark (1,1.5) with a green circle. How is that done? -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW |
|
From: John H. <jd...@gm...> - 2010-02-14 02:55:23
|
On Sat, Feb 13, 2010 at 8:03 PM, Wayne Watson <sie...@sb...> wrote: > Suppose I plot a line from (0,0) to (1,1.5) to (2,2). Now I want to mark > (1,1.5) with a green circle. How is that done? You've posted repeatedly about how confusing the docs are, asking what you should read and what steps you should take to learn python, numpy, scipy, matplotlib, etc. Lots of people have given you detailed responses. The answer to this particular question is covered in the "pyplot tutorial" one of the first and most basic documents in the matplotlib documentation, and it is covered in the first section of that tutorial, which suggests that you haven't read or digested even the most basic documentation. http://matplotlib.sourceforge.net/contents.html We have spent years writing this code and provided hundreds of examples, as well as 800+ pages of documentation in PDF and html available for you to learn from. We don't expect you to read it all before asking questions and as you've seen the people here are more than happy to answer your questions. Give them the courtesy of paying attention to their answers, and when they point you to documentation or examples, read it before asking another variant of the same question. JDH |
|
From: Wayne W. <sie...@sb...> - 2010-02-14 04:29:06
Attachments:
JoinedLineMarkers.png
|
Well, I'm not quite sure what to say to your claim. In certain instances I am trying to get through to someone here that something is missing for newbies. In one word, pedagogy (as perhaps in a text book, not a reference manual or dictionary). I'm trying to be positive about it, and not negative. Positive criticism I hope. I apologize if I offend you. Note the post of my to-do list here a few days ago. Clearly I have a number of things to do to better understand what is going on, and I plan to do them. Every item was gleaned from this mailing list. Everyone. I have the 868 page pdf that that someone mentioned (It is perhaps the best source here, but is very long for newbies.), and I have searched it for clues on how to proceed in this instance. I have seen references to marker in the document, set_marker, edge, etc. I've looked through the doc you suggested in the link. I have looked at a good number or examples on various questions I have about matplotlib to see their applicability. Examples are not necessarily education. I'm not sure you really understand my question. I see examples on how to produce markers at every join of lines.That's really easy. I do not see how to put a single marker on the plot. Not one at each join. I'll draw you a picture and attach it. The attachment consists of maybe 100 joined lines. They are so short that they look like a straight line in many cases. Nevertheless,I'd like to mark the joins in such a way that suggests meaningful points. These lines represent a path. Sometimes it dodges away from the main path a good distance, or may go backwards*. At the start I'd like to put a marker (perhaps green), 90 points away I'd like to put another marker, and finally at the end another marker (perhaps red). The image I produced doesn't not exactly produce this, but the point is four markers, and not 100. Is it possible to do that? A friend of mine tells me that in MatLab that it is. * Yes, I read about plot display navigation in the big 868 page file. This will have a good payoff to the users of the program I'm working on. The developer put an MPL plot in it, and no description of the plot navigation. On 2/13/2010 6:55 PM, John Hunter wrote: > On Sat, Feb 13, 2010 at 8:03 PM, Wayne Watson > <sie...@sb...> wrote: > >> Suppose I plot a line from (0,0) to (1,1.5) to (2,2). Now I want to mark -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW |
|
From: Philipp B. <li...@ro...> - 2010-02-14 09:13:57
|
Why don't you just use the code provided here: http://matplotlib.sourceforge.net/examples/api/watermark_image.html The first thing to do when you want to plot something is maybe to look at the examples section, isn't it? It shows pretty good how to not only mark points, but also to mark points with semi-transparent circles. Please keep in mind: Plotting a set of lines and mark several points produces exactly the same image as plotting a set of lines and, above that, plot a set of circles. Maybe there are "cleaner" solutions, but to get an impression how to do things this might be enough. Cheers Philipp |
|
From: Wayne W. <sie...@sb...> - 2010-02-14 19:08:48
|
Did you see the figure I included to John? If not, let me put it simply. Suppose you have 50 straight sticks connected at their ends with some hook. I want to color the hook holding stick 10 to 11, but color no other hook. Not 99 hooks. Yesterday, I tried to do a simple plot of three points without markers. Worked fine. I then tried something like plot(1,2,"bs"). I got an error . I tried variations on the plot with qualifiers. Zero. That seems like it should put the marker right at (1,2). My immediate reaction to your example, is that it colors every hook. Am I missing something in your example? On 2/14/2010 1:13 AM, Philipp Bender wrote: > Why don't you just use the code provided here: > > http://matplotlib.sourceforge.net/examples/api/watermark_image.html > > The first thing to do when you want to plot something is maybe to look at the > examples section, isn't it? It shows pretty good how to not only mark points, > but also to mark points with semi-transparent circles. > > Please keep in mind: Plotting a set of lines and mark several points produces > exactly the same image as plotting a set of lines and, above that, plot a set > of circles. Maybe there are "cleaner" solutions, but to get an impression how > to do things this might be enough. > > Cheers > Philipp > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW |
|
From: Jae-Joon L. <lee...@gm...> - 2010-02-14 14:30:10
|
On Sat, Feb 13, 2010 at 11:28 PM, Wayne Watson <sie...@sb...> wrote: > Well, I'm not quite sure what to say to your claim. In certain instances I > am trying to get through to someone here that something is missing for > newbies. In one word, pedagogy (as perhaps in a text book, not a reference > manual or dictionary). I'm trying to be positive about it, and not negative. > Positive criticism I hope. I apologize if I offend you. The main matplotlib documentation has a section called "user's guide" (http://matplotlib.sourceforge.net/contents.html). And the third item in the user's guide is "pyplot tutorial". So, I believe anyone who're willing to learn matplotlib, is willing to read through some sections of the user's guide and at least the tutorial. Is my standard too high? I'm not saying that the documentation is complete, and any suggestion (or even contribution) will be very appreciated. However, while you're saying that "pedagogy" is missing in our documentation, but it seems like that you haven't even read the very basic tutorial (because, as John said, the answer to your original question is in that tutorial). And I doubt how this could be positive criticism (while I understand you want to be positive). Anyhow, for your original question, try plot([0, 1, 2], [0, 1.5, 2], "-") plot([1], [1.5], "go") -JJ |
|
From: Wayne W. <sie...@sb...> - 2010-02-14 19:39:30
|
Thank you for the code below. Yes, it actually does what I want it to do. The difference in what I did similarly yesterday (see my response to Philipp moments ago) is the [ ], a list. All this for one simple bit of list notation. Somehow I'm not getting through to anyone what I have actually read. I do not plan to repeat it again here. If I have some time in the near future, I will write a line by line criticism of the basic tutorial. OK, maybe the first page*. I already made some remarks about 5-6 days ago about that document. I think it was that one. I'll submit it to one of the lists John provided on where I should send issues about the guide. Now to put an end to the show() question. See my next post in a few minutes. Subject is down another pathway I think. * Subject is "FAQ Page Needs Some Work" On 2/14/2010 6:29 AM, Jae-Joon Lee wrote: > On Sat, Feb 13, 2010 at 11:28 PM, Wayne Watson > <sie...@sb...> wrote: > >> Well, I'm not quite sure what to say to your claim. In certain instances I >> am trying to get through to someone here that something is missing for >> newbies. In one word, pedagogy (as perhaps in a text book, not a reference >> manual or dictionary). I'm trying to be positive about it, and not negative. >> Positive criticism I hope. I apologize if I offend you. >> > The main matplotlib documentation has a section called "user's guide" > (http://matplotlib.sourceforge.net/contents.html). And the third item > in the user's guide is "pyplot tutorial". So, I believe anyone who're > willing to learn matplotlib, is willing to read through some sections > of the user's guide and at least the tutorial. Is my standard too > high? > > I'm not saying that the documentation is complete, and any suggestion > (or even contribution) will be very appreciated. However, while you're > saying that "pedagogy" is missing in our documentation, but it seems > like that you haven't even read the very basic tutorial (because, as > John said, the answer to your original question is in that tutorial). > And I doubt how this could be positive criticism (while I understand > you want to be positive). > > Anyhow, for your original question, try > > plot([0, 1, 2], [0, 1.5, 2], "-") > plot([1], [1.5], "go") > > -JJ > > -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW |
|
From: Philipp B. <li...@ro...> - 2010-02-14 21:39:23
|
Hi Wayne, (I wanted to answer you directly but the mail came back, don't know why) I have several points that you really should work on if you expect anyone to answer to your mails in future. First, you should check the destination of your messages. I got at least three of your messages addressed only for me, you obviously wanted to send them to the list but they only reached me. So I didn't answer because the mailing list should be an open and searchable discussion platform and I didn't want to forward your message to the list or something like that. Please check that carefully in future. The next thing is that everyone must have the feeling that you completely ignore replies. This link here should have been an alert for you: http://www.freebsd.org/doc/en/articles/mailing-list-faq/etiquette.html This was posted as reply to one of your mails. One thing explained there is to not cite the original mail after the own reply, instead you should cite the original issue at the beginning or in parts directly before the parts of the answer. See below: >> How to do foo bar? Just like that. You see? The same thing about your footnotes*. Another thing is the HTML I received from your adress two times -- HTML has neither benefit nor a good reputation in mailing lists. I delete HTML mails without reading it in most cases. And, but that's maybe more a personal thing, I find it very unfriendly to ask in the subject and write in the body something like "(see subject)" -- we take the time to read your message, in respect to that you also should take the time to ask a complete question. Please don't misunderstand this message -- I don't want to blame you, I want to help you and make sure that you get answers to your questions in future. Regards, Philipp * like this one here. They don't help you, they don't explain anything, they don't help me reading the message, they have absolutely no benefit. |
|
From: Wayne W. <sie...@sb...> - 2010-02-15 15:40:14
|
Hi, Phillip. don't know why the mail would be returned. The address I see above is correct. sie...@sb.... The only thing I can think of is that yahoo mail wanted you to allow you to ask for permission. Beats me. Frankly, I've never really liked the reply format of mail lists. I use Thunderbird on Win. Sometimes I see messages in my inbox from someone and wonder are they trying for a private comm or just sending me a courtesy msg so that I should follow up on the list. Then there's Reply vs Reply All, and some filter problems. The latter can produce what I call the boomerang effect. Mail intended for me goes right into the list folder. There are goblins out there. :-) To me all this can be solved by one word, Forum. Not a mail list. Aside from the possible cost (to the Python Org?), comm is much clearer on them. Perhaps one disadvantage is that some people apparently have some bizarre form of e-mail that is not suitable for them. Otherwise, I have no idea why they are not more often used. html not allowed? The rules just vary too much to follow this. Same with bottom vs top posting in NGs. My view, and I'm not trying to be unfriendly here, is if one doesn't like what they see, ignore it, and don't respond. +NG. Expect the unexpected. The warriors and self appointed moderators hang out there. Some are just begging for a fight. +e-mail. If you aren't communicating with your friends, misunderstanding often prevail. +Forums: Almost bliss. I must belong to 30 of them. I must say that I am really puzzled by your comments about a footnote. I really don't use them much. I've probably posted thousands of msgs to NGs, forums, mail lists and I've never heard word one about footnotes. I use them as I see fit, and that's not very often. In fact, I like your use of the footnote below. I'm not even going to touch etiquette. I'd be really impressed if anyone follows them. I'll just say this. Internet communication by any of the methods above is sometimes just plain weird. It takes patience to use these methods. That includes personal e-mail. Someone should write a book about it. Preferably a shrink of psychologist. IMHO, the internet is generally meant for easy and informal communications, and not studied carefully written posts. That doesn't mean some care isn't needed. I see matters as a running dialogs. Both parties need to ask questions about clarity. Too much is often assumed.Maybe I'll write about it. Let's not hold our breaths. Hey, no footnotes used above. VBG Cheers. On 2/14/2010 1:39 PM, Philipp Bender wrote: > Hi Wayne, > > (I wanted to answer you directly but the mail came back, don't know why) > I have several points that > you really should work on if you expect anyone to answer to your mails in > future. First, you should check the destination of your messages. I got at > least three of your messages addressed only for me, you obviously wanted to > send them to the list but they only reached me. So I didn't answer because the > mailing list should be an open and searchable discussion platform and I didn't > want to forward your message to the list or something like that. Please check > that carefully in future. > > The next thing is that everyone must have the feeling that you completely > ignore replies. This link here should have been an alert for you: > > http://www.freebsd.org/doc/en/articles/mailing-list-faq/etiquette.html > > This was posted as reply to one of your mails. One thing explained there is to > not > cite the original mail after the own reply, instead you should cite the > original issue at the beginning or in parts directly before the parts of the > answer. See below: > > >>> How to do foo bar? >>> > Just like that. > > You see? The same thing about your footnotes*. > > Another thing is the HTML I received from your adress two times -- HTML has > neither benefit nor a good reputation in mailing lists. I delete HTML mails > without reading it in most cases. > > And, but that's maybe more a personal thing, I find it very unfriendly to ask > in the subject and write in the body something like "(see subject)" -- we take > the time to read your message, in respect to that you also should take the > time to ask a complete question. > > Please don't misunderstand this message -- I don't want to blame you, I want > to help you and make sure that you get answers to your questions in future. > > Regards, > Philipp > > * like this one here. They don't help you, they don't explain anything, they > don't help me reading the message, they have absolutely no benefit. > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW |
|
From: Filipe P. A. F. <oc...@gm...> - 2010-02-14 16:11:30
|
Dear Wayne Watson, As yourself I'm also new to matplotlib (and python) and I know that learning such a library can be overwhelming at first. Still, this community/mailist has answered all my newbie questions, even when they were clearly in the manual or have already been answered in previous posts. All this free of charge! We actually have the privilege of having the developers inhabiting the user list! This is not true in many users-lists that I dwell. You mentioned matlab in your message as the way to go. If your project has a budget for license and support, maybe that is indeed the way to go. Otherwise, if you come from a matlab background as myself, you might be interested in these two links: http://www.scipy.org/NumPy_for_Matlab_Users and http://mathesaurus.sourceforge.net/matlab-numpy.html They are not matplotlib references, but help to understand how things are done before you "fire-a-plot". Hope that help you in your learning adventure. Also, you might find useful to read this: http://www.freebsd.org/doc/en/articles/mailing-list-faq/etiquette.html It is BSD related, but most is true for any maillist. Best, Filipe On Sat, Feb 13, 2010 at 9:03 PM, Wayne Watson <sie...@sb...>wrote: > Suppose I plot a line from (0,0) to (1,1.5) to (2,2). Now I want to mark > (1,1.5) with a green circle. How is that done? > -- > "Crime is way down. War is declining. And that's far from the good > news." -- Steven Pinker (and other sources) Why is this true, but yet > the media says otherwise? The media knows very well how to manipulate us > (see limbic, emotion, $$). -- WTW > > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Eric F. <ef...@ha...> - 2010-02-14 23:50:26
|
Wayne Watson wrote: > Thank you for the code below. Yes, it actually does what I want it to > do. The difference in what I did similarly yesterday (see my response to > Philipp moments ago) is the [ ], a list. All this for one simple bit of > list notation. Newer versions of mpl do not require the list notation when plotting a single point. I don't recall when I made that change. Seems like quite a while ago, but evidently it was after the release you are using. Eric |
|
From: Tim M. <tim...@gm...> - 2010-02-15 14:06:23
|
Hello, I have a similar problem to: > Suppose I plot a line from (0,0) to (1,1.5) to (2,2). Now I want to mark > (1,1.5) with a green circle. How is that done? I am performing a curve fit and also showing a distribution in my plot. In order to help the reader to evaluate the result I would like to draw certain boundaries (vertical and horizontal line). While I am aware on how to draw such lines, I would like to know wheather there are some functions in matplotlib which help me to retrieve the coordinates a) at which two curves intersect b) at which a distribution reaches a certain value? Example: How do I get the y-axis value which is reached by the green curve in http://matplotlib.sourceforge.net/_images/histogram_demo_extended_021.png a x-axis value of in 175? I could proably use a solver from numpy like http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.solve.html#numpy.linalg.solve but if I plot a distribution, the equation of the envelove is unknown at the first place. I'd appreciate your help or pointers to examples. Thanks a lot in advance, Timmie |
|
From: Eric F. <ef...@ha...> - 2010-02-15 22:58:45
|
Tim Michelsen wrote: > Hello, > I have a similar problem to: >> Suppose I plot a line from (0,0) to (1,1.5) to (2,2). Now I want to mark >> (1,1.5) with a green circle. How is that done? > Your problem is not similar to the above; the problem above is solved with a simple call to "plot". > I am performing a curve fit and also showing a distribution in my plot. > In order to help the reader to evaluate the result I would like to draw certain > boundaries (vertical and horizontal line). > While I am aware on how to draw such lines, I would like to know wheather there > are some functions in matplotlib which help me to retrieve the coordinates > > a) at which two curves intersect > b) at which a distribution reaches a certain value? > I think this is strictly a computational problem, not a plotting problem, so I suggest you post the question to the numpy or scipy lists. Eric > Example: > How do I get the y-axis value which is reached by the green curve in > http://matplotlib.sourceforge.net/_images/histogram_demo_extended_021.png > a x-axis value of in 175? > > I could proably use a solver from numpy like > http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.solve.html#numpy.linalg.solve > but if I plot a distribution, the equation of the envelove is unknown at the > first place. > > I'd appreciate your help or pointers to examples. > > Thanks a lot in advance, > Timmie > > > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |