Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am currently modelling traffic and my map of roads consists of nodes connected with lines. For each road there is maximum capacity and amount of traffic and each road therefore has a utility value between 0 and 1.

To my question; I am wondering whether there is a colouring method for my lines in tikz that defines the colour by a value. For example I may want a high utility value to be red and a low utility level to be green and values in between are gradients of the booth. Is this possible in some way?

EDIT: The answer in the link is useful. I am now updating all my values to my lines manually; is there perhaps a way to retrieve them from a vector?

share|improve this question
3  
Did you read How to map value to color using TikZ? –  Paul Gaborit May 8 at 13:03
    
Yes thank you that solved it. Although I am now updating all my values to my lines manually; is there perhaps a way to retrieve them from a vector? –  Seb May 11 at 9:05
    
You may ask a new question or complete this one. –  Paul Gaborit May 12 at 21:18
    
Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Paul Gaborit May 13 at 16:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.