TypeError: this.Plotly.newPlot is not a function in Microsoft Learn platform

Ashish Chandra 100 Reputation points
2023-10-19T22:32:37.1266667+00:00

I am using the Microsoft Learn platform https://learn.microsoft.com/en-us/training/modules/introduction-to-classical-machine-learning/3-exercise-separate-data-test-model

The kernel I have selected is azureml_py38

The code that is being executed within the sandbox is as follows:

import graphing # Custom graphing code. See our GitHub repository for details

# Let's take a quick look at our data
graphing.scatter_2D(data, label_x="date", label_y="min_temperature", title="January Temperatures (°F)")


I get this error any time the graphing library is being used:

TypeError: this.Plotly.newPlot is not a function

I am using the Chrome browser on Ubuntu 20.04.6 LTS

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,978 questions
{count} votes

4 answers

Sort by: Most helpful
  1. ntwari bruce 15 Reputation points
    2023-10-23T20:52:35.12+00:00

    I have used matplotlib for visualization and wrote an entire no code for visualizing my data.

    3 people found this answer helpful.

  2. Matti Leskinen 5 Reputation points
    2023-11-15T13:10:11.8366667+00:00

    I asked this from the Bing AI chatbot

    Change this following code to use matplotlib

    import graphing # Custom graphing code. See our GitHub repository for details

    graphing.scatter_2D(data, label_x="date", label_y="min_temperature", title="January Temperatures (°F)")

    And atleast it's drawing something now.

    Hope this helps.

    1 person found this answer helpful.
    0 comments No comments

  3. Crhistian Souza 5 Reputation points
    2024-02-20T22:07:15.32+00:00

    Hi Guys! On top of all, I'm very disappointed that a Microsoft Learn course shows issues like that! :-( That said, I found to contour this problem by using ChatGPT to help me migrate all code of the module I am studying to my local computer. I copied and saved the code into Python script files (.py), including the problematic graphing unit, which I saved locally as graphing.py. By doing this I finally could figure out what modules were used in graphing that I had to install on my computer. After some back and forth, voilà! I finally can see the graphs! I'm running all this in Visual Studio. Anyway, this solution was also a great opportunity for me to learn more about Python scripts, that's I suggest you to try the same!

    1 person found this answer helpful.
    0 comments No comments

  4. Q&A Assist
    2023-10-19T22:32:37.13+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error message TypeError: this.Plotly.newPlot is not a function suggests that the Plotly function is not being recognized as a function. This could be due to a few reasons, such as the Plotly library not being properly installed or imported.

    Based on the provided context, it seems that the Plotly library needs to be installed and attached to the cluster in order to be used. Additionally, the output_type argument needs to be specified as 'div' when calling the plot() function, and the output of the plot() function needs to be passed to the displayHTML() function.

    It's possible that the graphing library being used in the code is not properly importing or using the Plotly library. I would recommend checking the graphing library code to ensure that Plotly is being properly imported and used.

    References:

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.