Skip to content

Semicolon in plot: Video part #36 #297

Discussion options

You must be logged in to vote

Hey @kaustubhharapanahalli,

The semicolon hides Matplotlib outputs afterwards (only shows the plot).

Try with/without in a notebook and you'll see what I mean.

With:

def plot_predictions(train_data=X_train, 
                     train_labels=y_train, 
                     test_data=X_test, 
                     test_labels=y_test, 
                     predictions=None):
  """
  Plots training data, test data and compares predictions.
  """
  plt.figure(figsize=(10, 7))

  # Plot training data in blue
  plt.scatter(train_data, train_labels, c="b", s=4, label="Training data")
  
  # Plot test data in green
  plt.scatter(test_data, test_labels, c="g", s=4, label="Testing data")

  if predic…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mrdbourke
Comment options

@kaustubhharapanahalli
Comment options

Answer selected by kaustubhharapanahalli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants