10 examples of 'plot in python' in Python

Every line of 'plot in python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
28def oplot(*args, **kwargs):
29 global _plt
30 _plt.kwargs.update(kwargs)
31 _plt.args += _plot_args(args)
32 _plot_data(kind='line')
16def plot_using_plotly(title,traces,filename):
17 data = Data(traces)
18 layout = {
19 "autosize": True,
20 "height": 1000,
21 "showlegend": True,
22 "title": title,
23 "width": 2000,
24 "xaxis": {
25 "autorange": True,
26 "title": "Time (days)",
27 },
28 "yaxis": {
29 "autorange": True,
30 "title": "Token Amount"
31 },
32 "yaxis2":{
33 "title":'Price(USD)',
34 "overlaying":'y',
35 "side":'right'
36 }
37 }
38 fig = Figure(data=data, layout=layout)
39 plot_url = plot_helper(fig,filename)
40
41 print(title + " --- " + plot_url)
42 return plot_url
857def plot(self, showlnl=False, **kwargs):
858 return SEDPlotter.plot_sed(self.sed, showlnl, **kwargs)
50def plot_(x, y):
51
52 plt.xlabel('# Probe Items', fontsize=fontsize)
53 plt.ylabel('Recall', fontsize=fontsize)
54 plt.xticks(fontsize=ticksize)
55 plt.yticks(fontsize=ticksize)
56
57 plot_one('rq_irregular', 'red', x, y, ':', 's')
58 plot_one('rq', 'black', x, y, '-', 'o')
59
60 plt.legend(loc='lower right', fontsize=ticksize)
61 plt.show()
66def plotter():
67 global values,scale1,scale2
68 NumberSamples=min(len(values),scale1.get())
69 CurrentXAxis=pylab.arange(len(values)-NumberSamples,len(values),1)
70 line1[0].set_data(CurrentXAxis,pylab.array(values[-NumberSamples:]))
71 ax.axis([CurrentXAxis.min(),CurrentXAxis.max(),0,3.5])
72 drawing.draw()
73 root.after(25,plotter)
42def plot(self, name, y):
43 '''
44 self.plot('loss',1.00)
45 '''
46 x = self.index.get(name, 0)
47 self.vis.line(Y=np.array([y]), X=np.array([x]),
48 win=unicode(name),
49 opts=dict(title=name),
50 update=None if x == 0 else 'append'
51 )
52 self.index[name] = x + 1
232def plots(data, model, nameuser=lambda x: x):
233 agg.FigureCanvasAgg(plot_dates(model)).print_figure("dates.pdf")
234 agg.FigureCanvasAgg(plot_users(model, nameuser=nameuser)).print_figure("users.pdf")
235 agg.FigureCanvasAgg(plot_rdates(model)).print_figure("res-dates.pdf")
236 agg.FigureCanvasAgg(plot_rnth(data, model)).print_figure("res-nth.pdf")
217def plot(f,g,c,s=None,u=None,clip=None):
218 n,nlag = len(c[0]),len(c)
219 s1 = Sampling(n,1.0,0.0)
220 slag = Sampling(nlag,1.0,-(nlag-1)/2)
221 panel = PlotPanel(2,1,PlotPanel.Orientation.X1RIGHT_X2UP)
222 panel.mosaic.setHeightElastic(0,25)
223 panel.mosaic.setHeightElastic(1,100)
224 panel.setVLimits(1,slag.first,slag.last)
225 fv = panel.addPoints(0,0,s1,f)
226 gv = panel.addPoints(0,0,s1,g)
227 gv.setLineColor(Color.RED)
228 cv = panel.addPixels(1,0,s1,slag,c)
229 cv.setInterpolation(PixelsView.Interpolation.NEAREST)
230 if clip:
231 cv.setClips(0.0,clip)
232 cv.setColorModel(ColorMap.JET)
233 if s:
234 sv = panel.addPoints(1,0,s)
235 sv.setLineColor(Color.WHITE)
236 sv.setLineStyle(PointsView.Line.DOT)
237 sv.setLineWidth(3)
238 if u:
239 uv = panel.addPoints(1,0,u)
240 uv.setLineColor(Color.WHITE)
241 uv.setLineWidth(3)
242 panel.setHLabel("sample")
243 panel.setVLabel(0,"f & g")
244 panel.setVLabel(1,"lag")
245 frame = PlotFrame(panel)
246 frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)
247 frame.setFontSize(18)
248 frame.setSize(1000,800)
249 frame.setVisible(True)
28def plot(x: np.ndarray, y: np.ndarray, show: bool = True, **kwargs) -> None:
29 for yi in np.unique(y):
30 mask = y == yi
31 plt.plot(x[mask, 0], x[mask, 1], "o", label=str(yi),
32 alpha=kwargs.get("alpha", 0.6), ms=kwargs.get("ms", 1))
33 plt.legend()
34 if show:
35 plt.show()
41def filterplot(self, x, y, xf, yf):
42 plt.plot(x, y, '.', color='blue', alpha=0.5)
43 plt.plot(xf, yf, '-', color='red')

Related snippets