Menu

set color for a cell or a point

General
Anonymous
2010-03-18
2013-04-22
  • Anonymous

    Anonymous - 2010-03-18

    hello!

    i need to have more then one graph in a plot. so i pushed all point in a TripleField and arranged two different graphs with a CellField.
    Now I want to have a blue graph and a red graph. Is there a possibility to color the cells or to set the color for the points?

    Thank You!

     
  • uky_ka

    uky_ka - 2010-03-24

    I would also like to know if it is possible to assign a color to each cell. I looked at the mesh2 example where one can set the colors based on a color map. Reading the Colors section in the manual I realize that every single point can be assigned an RGBA value based on the z-coordinate values. But, I would like to be able to assign a color for each cell depending on a different parameter (such as magnitude of current).

    The reason for this is in my Computation EM problems I compute currents on each cell and I wish to assign a color for each cell based on the computed current.

    Thanks,
    uky_ka

     
  • FeBro

    FeBro - 2010-10-05

    But, I would like to be able to assign a color for each cell depending on a different parameter (such as magnitude of current).

    thats exactly what I need, maybe anyone has an idea?

     
  • FeBro

    FeBro - 2010-10-05

    got it :)

    it's quite simple… you just have to subclass QWT3D::Color and implement "operator()(double x, double y, double z)". you have to define your own constructor and pass the data elements you need (e. g. a pointer to your CellField). You store that pointer as member and then you can use it in the mentioned "operator()" :)

     

Log in to post a comment.

MongoDB Logo MongoDB