Click on the ‘Scatter chart’ option in the charts thats show up. In the Chart group, click on the Insert Scatter Chart icon. In Excel, scatter charts are available with markers only, smooth or straight lines only, or a combination of the two. This approach seems however to be suboptimal: aside for the verbosity required to add a single line, it also makes me manually "sample" the straight line, and it adds the line height to the tooltip on mouse hover. Select the columns that have the data (excluding column A) Click the Insert option. I went through the documentation, for example the section on line and scatter and that on line charts, but none of the examples seem to cover how to overlay different plots, or simply draw straight lines and similar shapes.Ī naive approach to do this is to just add the line as a second scatter plot, like the following: import otly as py ![]() What if I now want to add a (say) horizontal line to this plot? ![]() Adjust your data so that the X Axis is the split. Whereas plotly.express has two functions scatter and line, go.Scatter can be used both for plotting points (makers) or lines, depending on the value of mode. ![]() Consider the following MWE to draw a scatter plot using the python API to plotly: import otly as py Split your data into two halves, with a common horizontal edge. Scatter and line plots with go.Scatter If Plotly Express does not provide a good starting point, it is possible to use the more generic go.Scatter class from aphobjects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |