February 06, 2023

Line charts Logarithmic Scale

Welcome to Taipy Forums Taipy GUI Line charts Logarithmic Scale

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #238142
    agui008agui008
    Participant

    It seems that the Line charts only support the linear Scale on x, y axis, Is there’s way to plot Logarithmic scale?
    Thanks

    #238143
    Florian JactaFlorian Jacta
    Keymaster

    Hi,

    It is possible to plot a chart with a logarithm scale. Here is a quick demo of how the x and y axes can be of the log scale. Layout parameters are being used to change the default behavior of the x and y-axis.

    
    from taipy.gui import Gui
    
    data = {"x": [0, 1, 2, 3, 4, 5, 6, 7, 8],
            "y": [8, 7, 6, 5, 4, 3, 2, 1, 0]}
    
    layout = {
      "xaxis": {
        "type": 'log',
        "autorange": True
      },
      "yaxis": {
        "type": 'log',
        "autorange": True
      }
    }
    
    Gui("<|{data}|chart|x=x|y=y|layout={layout}|>").run()
    

    Other options of the same type can be found here: https://plotly.com/javascript/reference/layout/xaxis/

    I hope this helps. Don’t hesitate to come back to me with more questions!

    Best regards,
    Florian Jacta

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.