Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 07 23:56

    tshead2 on main

    Begin exploring graphcat and xm… (compare)

  • Jan 07 07:32

    tshead2 on main

    Bump version number. (compare)

  • Jan 07 07:30

    tshead2 on v1.0.0

    (compare)

  • Jan 07 07:30

    tshead2 on main

    Toyplot version 1.0.0 (compare)

  • Jan 07 06:26

    tshead2 on main

    Add missing modules to the docu… (compare)

  • Jan 07 05:47

    tshead2 on main

    We don't need to combine parall… (compare)

  • Jan 07 05:14

    tshead2 on main

    Temporarily disable Eades graph… (compare)

  • Jan 07 04:59

    tshead2 on main

    Do a DOM comparison for HTML ar… (compare)

  • Jan 07 03:55

    tshead2 on main

    Add missing CI dependency. (compare)

  • Jan 07 03:43

    tshead2 on main

    Add missing CI dependency and a… Update support links. (compare)

  • Jan 07 03:27

    tshead2 on main

    Add a missing CI dependency, an… (compare)

  • Jan 07 03:21

    tshead2 on main

    Add missing CI dependency. (compare)

  • Jan 07 03:20

    tshead2 on main

    Add missing CI dependency. (compare)

  • Jan 07 03:18

    tshead2 on main

    Fix CI build problems. (compare)

  • Jan 07 03:14

    tshead2 on master

    (compare)

  • Jan 07 03:14

    tshead2 on main

    Bump version number after relea… Remove deprecated API. Update the portability statemen… and 48 more (compare)

  • Jan 07 03:11

    tshead2 on master

    Update setup.py with new projec… (compare)

  • Jan 07 03:03

    tshead2 on master

    Switch to Github Actions for co… (compare)

  • Jan 07 02:59

    tshead2 on master

    Fix an advertent omission in th… (compare)

  • Jan 06 08:07

    tshead2 on master

    Break the documentation config … (compare)

Timothy M. Shead
@tshead
@matrixbot - when you create your canvas, add autoformat=“png”.

If you find that you’re doing it a lot, you can also do

import toyplot.config
toyplot.config.autoformat = “png”

to make it the default (at the top of your notebook, say).

matrixbot
@matrixbot
hannes ah nice!, thanks :)
Michel Pelletier
@michelp
good day, I'm working on a little side project to visualize graph traversal using adjacency matrix multiplication using GraphBLAS. What I was hoping for was a tip on how to put two plots side by side in toyplot. For example, here's a static image of the layout i'm looking for https://github.com/michelp/pggraphblas/raw/master/docs/AdjacencyMatrixBFS.svg?sanitize=true
The static image shows one "step" in a matrix x vector multiplication using a boolean semiring. In addition to discovering how to do that layout with toyplot (which looks very amazingly cool btw!) if anyone has a tip on how i can even possibly animate the process i do eventually hope to many that possible, but first things first, being able to layout a graph next to its adjacency matrix is my first step
I have the code that generates the graph and the matrix, i'm just not sure how to put them next to each other in the same cell (i'm using jupyter)
Michel Pelletier
@michelp
ah i think i answered my own question using Canvas layouts! thanks for the very cool library anyway :)
Timothy M. Shead
@tshead
Michel: glad you got it going, and thanks for the kind words 😊
Michel Pelletier
@michelp
I'm moving along pretty nicely with my project, but have run into one issue, is it possible to dynamically assign edge labels to a graph? On the examples at https://toyplot.readthedocs.io/en/stable/graph-visualization.html#edge-rendering all the edge labels are the same static value, but i'd like to assign my labels per edge to correspond to the value in the equivalent adjacency matrix cell.
Timothy M. Shead
@tshead
@michelp : it’s poorly tested, but you should be able to pass a sequence of markets to mmarkers.
Michel Pelletier
@michelp
ah ok, i guess that was the obvious thing i didn't try :)
matrixbot
@matrixbot
hannes i often want to use data from dictionaries with toyplot, eg .keys() as x and .items() as y axes. unfortunately this leads to "TypeError: float() argument must be a string or a number, not 'dict_keys'" from https://toyplot.readthedocs.io/en/stable/_modules/toyplot/require.html#scalar_array because numpy's conversion to an array does not like python's dict views or iterators
hannes i can wrap it into a list() call but that seems ugly
hannes no idea why numpy does not support those but i wonder if adding some logic to toyplot's scalar_array function would make sense for this usecase?
hannes ```
hannes Example of what I would love to use (in an explicite way):
import toyplot

data = {1: 5, 2: 3, 3: 4}

canvas = toyplot.Canvas()
axes = canvas.cartesian()

mark = axes.plot(
    data.keys(),
    data.values(),
)
Timothy M. Shead
@tshead
@matrixbot : I’d certainly accept a pull request to require.scalar_array() that handles a wider variety of sequences / iterators. Extra points if it isn’t a chain of isinstance calls … :)
matrixbot
@matrixbot
hannes :D
matrixbot
@matrixbot
hannes https://toyplot.readthedocs.io/en/stable/tutorial.html#scatterplots uses a shared x axis for a stacked plot, is there a way to make a "true" scatterplot of irregular data?
hannes i have unique x and y axes for each series
Timothy M. Shead
@tshead

@matrixbot : There is an implicit assumption with scatterplot() that your series are all the same length. When that isn’t the case, just make multiple calls to scatterplot() and you’ll get what you’re expecting.

Cheers,
Tim

egayer
@egayer
Hi all, new with toyplot and trying to figure out how I could use it with Spyder. Which render should I use ? thanks
matrixbot
@matrixbot
hannes it depends (tm)
hannes just use the default until it does not do what you need
egayer
@egayer
@matrixbot well, objects are created but nothing is displayed when using python inline backend or Qt5 backend.
Timothy M. Shead
@tshead
I’m unfamiliar with Spyder, but it looks like it has support for Jupyter notebooks. Try familiarizing yourself with Toyplot in a notebook.
matrixbot
@matrixbot
hannes egayer (Gitter): you can get a plot if you make the ipython console return your canvas object
hannes posted an image: Untitled.png
hannes hm, when using matplotlib, one can get an image in there from a script itself by calling plt.show()
hannes i guess that is a super magic command
egayer
@egayer
(@matrixbot sorry can't see the image)
hannes sad how bad the state of relaying between messaging services still is :(
egayer
@egayer
@matrixbot alright... my bad! that was simple ! I will try to see how it can be displayed on a Qt5 external window, if it can...
egayer
@egayer
btw last stupid question: is there the equivalent of the matplotlibrc file ? here I understand it would be a CSS file, but can't find the "default" style sheet. I would like to use it to learn how to create new CSS files (with specific axis color, grid dash lines for example) and call it for theming toyplot plots the way we can call matplotlib style sheets. thanks again
egayer
@egayer
just got half of an answer using canvas.style.items()
Timothy M. Shead
@tshead
@egayer - you can display a canvas in a Jupyter Qt console directly. I’ve expanded the documention on rendering at https://toyplot.readthedocs.io/en/latest/rendering.html to cover this more explicitly.
There is no default style sheet for Toyplot, you have to make those changes in your code when you create figures.
egayer
@egayer
@tshead thank you Timothy and thank you @matrixbot it is clear and works perfectly !
jemmasters
@jemmasters
is it possible to embed toyplot to tkiner, wxPython, Qt or kivy GUI frameworks?
matrixbot
@matrixbot
hannes i see no reason why not
Eaton Lab
@eaton-lab
Hi @tshead , I noticed that ._children lists no longer exist for canvas and axes objects. What is the recommended alternative for accessing child objects in v.0.19?
Timothy M. Shead
@tshead2

Hey @eaton-lab ! The replacement for _children is the _scenegraph, which is maintained by the canvas and provides a more flexible, open-ended way to keep track of relationships between objects. I created a notebook to demonstrate:

https://github.com/sandialabs/toyplot/blob/master/notebooks/scene-graph-usage.ipynb

You will see that there's more than one type of relationship, but "render" is equivalent to the old parent-child relationship. Note that you can access _scenegraph from the canvas or the axes, but it's all the same object. I'd be interested to hear how you're using it?

Cheers,
Tim

Eaton Lab
@eaton-lab
hi @tshead2 , I've been wondering whether you have plans for development of a 'radial' axes class? I envision this would be very useful for chord diagrams and various other circular plotting tools. And creating an axes class to automatically project marks into radial units would make it easier to create arc as lines or rectangles mapped into radial coordinates rather than creating a separate marker for arc-type elements.
Anyway, I bring this up after spending a ton of time writing support to project trees into radial positions on cartesian axes in toytree, which was painful but doable. As usual, getting the extents of text elements to work right was the hardest part.
Timothy M. Shead
@tshead
Hey, @eaton-lab! I’ve never needed radial axes in my work, but I had them in mind when I was developing the marks/coordinates idea Toyplot. The intent would be that bar marks would map to either wedges or arcs using polar coordinates, instead of boxes in cartesian coordinates. Got any screenshots? I’m curious whether polar coordinates are all that is needed, or whether you’re doing anything more sophisticated?
Eaton Lab
@eaton-lab
Screenshot from 2020-10-15 19-57-00.png
Screenshot from 2020-10-15 19-55-31.png
The first screencap above shows four three drawings. The first two are normal cartesian coordinates, the second two project polar coordinates into cartesian space. The last one uses curved edges, which wasn't yet supported in toyplot but I sort of kludged it together.