How to change axis to log scale for Mechanical charts?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 389
First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
edited June 2023 in Structures

How to change axis to log scale for Mechanical charts?

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 389
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
    Answer ✓

    For log scale you need to first get the axis you want to set to log-scale and then select if you would like the common log or the natural log, example code

    x_axis = figure.axes.get("bottom")
    x_axis.Logrithmic = chart.LogBase.LogBaseCommon  # For common log
    y_axis = figure.axes.get("left")
    y_axis.Logrithmic = chart.LogBase.LogBaseNatural  # For natural log