python - extra numbers showing up on my axes when i do multiple subplots in matplotlib -


Hi People First Dragon Question Here!

Such a big picture, I have a panel with 4 dataframes. I wanted a function that plots the panel in just 4 subplots, with a small bit of data processing on it ..

When I try to set up sub-stations, The two letters of my subplots get weird numbers 2 and more. I do not know where they come from, plain and simple, and no one seems to have the same problem any advice friends

  def plotAlexaPanel (getWebsiteListStatisticsOutput, select = 'gross', Defaultlookback = -200):? '' Properly formatted figs 'getWebsiteListStatistics plots', = plt.subplots axis (2, 2) #, sharex = true) fig.tight_layout () AX1 = fig.add_subplot (2, 2, 1) plotAlexaPanelSubPlot (AX1 , "ViewsPerU", getWebsiteListStatisticsOutput, Selection, defaultlookback) AX2 = fig.add_subplot (2, 2, 2) Plot AlexNapnSubBlot (ExC2, "View Pearm", GatewaySite ListTextput, Selection, Default Trackback) ax3 = Figs.Ed_Subplot (2, 2, 3) Plotelaxa pencilsbbott (x3, "ppmm"), get site lististics optup, selection, default trackback ) Ax4 = Anjir.ad_sbplot (2, 2, 4) plotAlexaPanelSubPlot (ax4, "PageRank", getWebsiteListStatisticsOutput, selection, defaultlookback) # plt.subplots_adjust (wspace = 0, hspace = 0) suptitle (selection, fontsize = 14, fontweight = 'bold') fig.set_size_inches (18.5,10.5) returns DEF plot Eleksapanl Sbblot (S ubplotaxis, subplotmetric, getWebsiteListStatisticsOutput, select = 'gross', defaultlookback = -200): If you choose ==' gross' If subplotmetric == ' PageRank 'Subplotmetric2 =' MinRank 'Elif Subplotmetric ==' ViewsPerU 'Subplotmetric2 =' overall views U 'Elif Upplotmetik ==' Dekiaprm 'Sbplat metric 2 =' overall view 'Elif Upplotmetri == 'Phuncpirm' Sbplat metric 2 = 'consolidated Reach' and: Sbplat metric 2 = Sbplatmatrik Whowsait Liststatiksoptput [ 'all'] [Sbplatametik 2] [default setting:]. = False, ax = subplotaxis) yoygrowth (getWebsiteListStatisticsOutput ['Total'] [subplotmetric2]) [defaultlookback:] Plot (narrative = false, ax = subplotaxis, secondary_y = true) and: getWebsiteListStatisticsOutput ['rawOutput'] [subplotmetric] [select] [default view:]. Plot (legend = false, ax = subplataxis) yoygrowth (getWebsiteListStatisticsOutp ut ['rawOutput'] [subplotmetric] [selection]) [defaultlookback:]. Plot (narrative = false, AX = subplotaxis, secondary_y = true) subplotaxis.set_ylabel (subplotmetric + '(Blue)') subplotaxis.right_ax.set_ylabel ( 'YoY% (Green)') subplotaxis.set_xlabel ( '') return  

I put a red arrow to highlight strange extra numbers

The problem is that your plt .subplots (2,2) on call statistics Adds four accessblot objects and adds fig.ed_subflip () calls each and every other *. You are doing asteroids in this second set of data, which is why fake tick labels span for zero one. This is the default graph when you do not plot any data in an example of axes.

The easiest way to fix this is with

  fig, axis = plt.subplots (2,2)  

/ P>

  fig = plt.figure ()  

which will stop adding unused axes.

* OK, behind the scenes fig.ed_subplepot () checks whether the data already has a subplot with this call signature and If this happens, instead of creating a new subplot, it gets the benefit of it, it is for your first subplot, but the next three has a slightly different call ownership, possibly due to the share x / Shayari related to logic, so make new subplots for them E. / P>


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -