FAQ
I'm looking for an example with canvas that produces, say, a complete x-y
plot of some data. By that I mean, it should do something like the following:

1. Produce x-y axes. The x-axis should be blue and the y-axis
should be green
2. Put a label on each axis (vertical and horizontal text)
3. Plot some data (3 points is enough) and connect the points
with a dashed line. Color one line red and the other green.
4. Position a title at some arbitrary place inside the x-y axes.
That is, not just a title above and outside the top of the
x-y area.

I just want to see how it's done. I'm not interested in a full-blown canned
class or widget that does an x-y plot given some data. If not exactly the
above, then something like it that gives me some idea of how to do such a
graph. Maybe there's a tutorial that does something like this as an example.

--
Wayne Watson (Nevada City, CA)

Web Page: <speckledwithStars.net>

Search Discussions

  • Grant Edwards at Sep 18, 2007 at 2:35 pm

    On 2007-09-18, W. Watson wrote:

    I'm looking for an example with canvas that produces, say, a
    complete x-y plot of some data.
    With what widget set?

    --
    Grant Edwards grante Yow! I'm a nuclear
    at submarine under the
    visi.com polar ice cap and I need
    a Kleenex!
  • W. Watson at Sep 18, 2007 at 5:23 pm
    What would be appropriate? What are the choices? I'm pretty new to Python,
    but am familiar with the XWindow widget set. I think it is available under
    Python, but if there's a more suitable choice, that's fine. I would think
    Tkinter would be the simplest choice. Yes, Tkinter would be preferable. It
    seems to be the GUI of choice.

    Grant Edwards wrote:
    On 2007-09-18, W. Watson wrote:

    I'm looking for an example with canvas that produces, say, a
    complete x-y plot of some data.
    With what widget set?
    --
    Wayne Watson (Nevada City, CA)

    Web Page: <speckledwithStars.net>
  • Kyosohma at Sep 18, 2007 at 7:36 pm

    On Sep 18, 12:23 pm, "W. Watson" wrote:
    What would be appropriate? What are the choices? I'm pretty new to Python,
    but am familiar with the XWindow widget set. I think it is available under
    Python, but if there's a more suitable choice, that's fine. I would think
    Tkinter would be the simplest choice. Yes, Tkinter would be preferable. It
    seems to be the GUI of choice.

    Grant Edwards wrote:
    On 2007-09-18, W. Watson wrote:

    I'm looking for an example with canvas that produces, say, a
    complete x-y plot of some data.
    With what widget set?
    --
    Wayne Watson (Nevada City, CA)

    Web Page: <speckledwithStars.net>
    I've heard a lot about drawing with the wxPython widget set as well.

    Some examples:

    http://wiki.wxpython.org/RecipesImagesAndGraphics

    Mike
  • Grant Edwards at Sep 18, 2007 at 7:51 pm

    On 2007-09-18, W. Watson wrote:

    What would be appropriate? What are the choices? I'm pretty new to Python,
    but am familiar with the XWindow widget set.
    There's no such thing as "the XWindow widget set". There are
    at least 8-10 different X Windows widget sets. The ones that I
    can name off the top of my head:

    Tk
    Athena
    Motif
    FLTK
    GTK
    Qt
    XRT
    WxWidgets (actually sort of meta-widget-set)

    http://en.wikipedia.org/wiki/Widget_toolkit

    http://en.wikipedia.org/wiki/List_of_widget_toolkits#On_Unix.2C_under_the_X_Window_System

    --
    Grant Edwards grante Yow! As President I have
    at to go vacuum my coin
    visi.com collection!
  • W. Watson at Sep 18, 2007 at 8:18 pm
    Tk is it. I'm really not interested in the others at this point.

    Grant Edwards wrote:
    On 2007-09-18, W. Watson wrote:

    What would be appropriate? What are the choices? I'm pretty new to Python,
    but am familiar with the XWindow widget set.
    There's no such thing as "the XWindow widget set". There are
    at least 8-10 different X Windows widget sets. The ones that I
    can name off the top of my head:

    Tk
    Athena
    Motif
    FLTK
    GTK
    Qt
    XRT
    WxWidgets (actually sort of meta-widget-set)

    http://en.wikipedia.org/wiki/Widget_toolkit

    http://en.wikipedia.org/wiki/List_of_widget_toolkits#On_Unix.2C_under_the_X_Window_System
    --
    Wayne Watson (Nevada City, CA)

    Web Page: <speckledwithStars.net>
  • Richard Townsend at Sep 18, 2007 at 9:58 pm

    On Tue, 18 Sep 2007 13:18:36 -0700, "W. Watson" wrote:

    Tk is it. I'm really not interested in the others at this point.
    John Grayson's book 'Python and Tkinter Programming' has a chapter on
    plotting Graphs and Charts. You can even download that chapter as a
    PDF file:

    http://www.manning-source.com/books/grayson/grayson_ch11.pdf

    See http://www.manning.com/grayson/ for more info about the book.
  • W. Watson at Sep 19, 2007 at 2:33 am
    Thanks. I've arranged for an inter-library loan(ILL), and probably will not
    get his book for several days yet. I've had the book before, but was really
    unable to get the time to pursue it (the ILL). I have his web site
    bookmarked. I do not yet plan to buy his book, web or hardbound yet. Maybe I
    can re-examine his site for examples, and find one that is appropriate.


    Richard Townsend wrote:
    On Tue, 18 Sep 2007 13:18:36 -0700, "W. Watson"
    wrote:
    Tk is it. I'm really not interested in the others at this point.
    John Grayson's book 'Python and Tkinter Programming' has a chapter on
    plotting Graphs and Charts. You can even download that chapter as a
    PDF file:

    http://www.manning-source.com/books/grayson/grayson_ch11.pdf

    See http://www.manning.com/grayson/ for more info about the book.
    --
    Wayne Watson (Nevada City, CA)

    Web Page: <speckledwithStars.net>
  • W. Watson at Sep 19, 2007 at 2:39 am
    Ah, I missed your link to Chap 11. That looks very helpful.

    W. Watson wrote:
    Thanks. I've arranged for an inter-library loan(ILL), and probably will
    not get his book for several days yet. I've had the book before, but was
    really unable to get the time to pursue it (the ILL). I have his web
    site bookmarked. I do not yet plan to buy his book, web or hardbound
    yet. Maybe I can re-examine his site for examples, and find one that is
    appropriate.


    Richard Townsend wrote:
    On Tue, 18 Sep 2007 13:18:36 -0700, "W. Watson"
    wrote:
    Tk is it. I'm really not interested in the others at this point.
    John Grayson's book 'Python and Tkinter Programming' has a chapter on
    plotting Graphs and Charts. You can even download that chapter as a
    PDF file:

    http://www.manning-source.com/books/grayson/grayson_ch11.pdf

    See http://www.manning.com/grayson/ for more info about the book.
    --
    Wayne Watson (Nevada City, CA)

    Web Page: <speckledwithStars.net>
  • W. Watson at Sep 19, 2007 at 1:23 pm
    Here seems to be another good source. <http://effbot.org/tkinterbook/canvas.htm>

    W. Watson wrote:
    Ah, I missed your link to Chap 11. That looks very helpful.

    W. Watson wrote:
    Thanks. I've arranged for an inter-library loan(ILL), and probably
    will not get his book for several days yet. I've had the book before,
    but was really unable to get the time to pursue it (the ILL). I have
    his web site bookmarked. I do not yet plan to buy his book, web or
    hardbound yet. Maybe I can re-examine his site for examples, and find
    one that is appropriate.


    Richard Townsend wrote:
    On Tue, 18 Sep 2007 13:18:36 -0700, "W. Watson"
    wrote:
    Tk is it. I'm really not interested in the others at this point.
    John Grayson's book 'Python and Tkinter Programming' has a chapter on
    plotting Graphs and Charts. You can even download that chapter as a
    PDF file:

    http://www.manning-source.com/books/grayson/grayson_ch11.pdf

    See http://www.manning.com/grayson/ for more info about the book.
    --
    Wayne Watson (Nevada City, CA)

    Web Page: <speckledwithStars.net>
  • Exhuma.twn at Sep 19, 2007 at 7:00 am

    On Sep 18, 11:58 pm, Richard Townsend wrote:
    On Tue, 18 Sep 2007 13:18:36 -0700, "W. Watson"

    wrote:
    Tk is it. I'm really not interested in the others at this point.
    John Grayson's book 'Python and Tkinter Programming' has a chapter on
    plotting Graphs and Charts. You can even download that chapter as a
    PDF file:

    http://www.manning-source.com/books/grayson/grayson_ch11.pdf

    Seehttp://www.manning.com/grayson/for more info about the book.
    Also, if the graph is really all you need, matplotlib might be a very
    interesting choice:
    http://matplotlib.sourceforge.net/

    It's got some user-interface facilities as well. But I never used
    those so far.
  • W. Watson at Sep 19, 2007 at 1:23 pm
    I'm just trying to get some feel for how canvas works. I'm about to modify a
    program I use for meteor work. It uses canvas to display images, and I plan
    to draw on the image. For example, I plan to draw compass headings on a
    circle every 30 degrees. Just warming up to the task.

    exhuma.twn wrote:
    On Sep 18, 11:58 pm, Richard Townsend wrote:
    On Tue, 18 Sep 2007 13:18:36 -0700, "W. Watson"

    wrote:
    Tk is it. I'm really not interested in the others at this point.
    John Grayson's book 'Python and Tkinter Programming' has a chapter on
    plotting Graphs and Charts. You can even download that chapter as a
    PDF file:

    http://www.manning-source.com/books/grayson/grayson_ch11.pdf

    Seehttp://www.manning.com/grayson/for more info about the book.
    Also, if the graph is really all you need, matplotlib might be a very
    interesting choice:
    http://matplotlib.sourceforge.net/

    It's got some user-interface facilities as well. But I never used
    those so far.
    --
    Wayne Watson (Nevada City, CA)

    Web Page: <speckledwithStars.net>
  • Hendrik van Rooyen at Sep 20, 2007 at 6:51 am

    "W. Watson" wrote:


    I'm just trying to get some feel for how canvas works. I'm about to modify a
    program I use for meteor work. It uses canvas to display images, and I plan
    to draw on the image. For example, I plan to draw compass headings on a
    circle every 30 degrees. Just warming up to the task.
    Don't be surprised if you can't draw a full circle - I have never managed it,
    but 359.99 degrees works fine

    - Hendrik
  • W. Watson at Sep 20, 2007 at 4:29 pm
    That's odd; however, it's likely close enough.

    Hendrik van Rooyen wrote:
    "W. Watson" wrote:

    I'm just trying to get some feel for how canvas works. I'm about to modify a
    program I use for meteor work. It uses canvas to display images, and I plan
    to draw on the image. For example, I plan to draw compass headings on a
    circle every 30 degrees. Just warming up to the task.
    Don't be surprised if you can't draw a full circle - I have never managed it,
    but 359.99 degrees works fine

    - Hendrik
    --
    Wayne Watson (Nevada City, CA)

    Web Page: <speckledwithStars.net>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedSep 18, '07 at 2:29p
activeSep 20, '07 at 4:29p
posts14
users6
websitepython.org

People

Translate

site design / logo © 2023 Grokbase