Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hi Everyone. For Some Reason, I Could Not Display My Matplotlib Plots (With Subplots) In Trains, While They Can Be Displayed Locally. Here Is An Example Plotting Function Which Could Not Show On Trains. It Would Be Really Helpful If Someone Could Check Th

Hi everyone. For some reason, I could not display my matplotlib plots (with subplots) in Trains, while they can be displayed locally. Here is an example plotting function which could not show on Trains. It would be really helpful if someone could check this for me. 🙂 Many thanks!
` import matplotlib.pyplot as plt
import numpy as np

def plot_subplots():
fig = plt.figure()
ax1 = fig.add_subplot(2, 2, 1)
ax2 = fig.add_subplot(2, 2, 2)
ax3 = fig.add_subplot(2, 2, 3)
ax4 = fig.add_subplot(2, 2, 4)
x = range(10)
y = range(10)
ax1.plot(x, y)
ax2.plot(x, y)
ax3.plot(x, y)
ax4.plot(x, y)
fig.show() `

  
  
Posted 4 years ago
Votes Newest

Answers 7


Thank you very much. 😄

  
  
Posted 4 years ago

Hi EagerStork23 ,

Thanks for catching this bug.
We also caught this issue, so a fix is scheduled to be released in one of the coming versions.
I'll update here once it will be released 🙂

  
  
Posted 4 years ago

TimelyPenguin76 I also found another plot display bug in trains. If I run multiple functions to produce multiple separate plots, only the first plot is displayed in trains. Could you also please check that as well?

  
  
Posted 4 years ago

The next version (0.14.0) should be released in a few weeks 🙂 .

  
  
Posted 4 years ago

Hi EagerStork23 , sure, i'll check it, but I will need some more information.

I run this example: https://github.com/allegroai/trains/blob/master/examples/matplotlib_example.py which produced 3 different plots and I can see those in the task's plot section, can you share what you run (general code without data)? Link to the task?

  
  
Posted 4 years ago

EagerStork23 However, the issue is only in the presentation of the graph (occurs when all subplots have the same label), so you can use the following workaround for solving it:

` import matplotlib.pyplot as plt

def plot_subplots():
fig = plt.figure()
ax1 = fig.add_subplot(2, 2, 1)
ax2 = fig.add_subplot(2, 2, 2)
ax3 = fig.add_subplot(2, 2, 3)
ax4 = fig.add_subplot(2, 2, 4)
x = range(10)
y = range(10)
ax1.plot(x, y)[0].set_label("label1")
ax2.plot(x, y)[0].set_label("label2")
ax3.plot(x, y)[0].set_label("label3")
ax4.plot(x, y)[0].set_label("label4")
fig.show() `

  
  
Posted 4 years ago

Thanks Alon. Roughly when do we expect this new version to be released?

  
  
Posted 4 years ago