make a effective figure in python

Solutions on MaxInterview for make a effective figure in python by the best coders in the world

showing results for - "make a effective figure in python"
Monica
14 Jan 2019
1plt.close('all')
2fig, ax = plt.subplots()
3for j,series in enumerate(df.columns[:-2]):
4    if(series=='UK'):
5        alphaVal = 1.
6        linethick=5
7    else:
8        alphaVal = 0.6
9        linethick = 3.5
10    ax.plot(df[series].index,
11                df[series]/100.,
12                color=colourWheel[j%len(colourWheel)],
13                linestyle = '-',
14                dashes=dashesStyles[j%len(dashesStyles)],
15                lw=linethick,
16                label=series,
17                alpha=alphaVal)
18ax.set_xlabel('')
19ax.yaxis.set_major_formatter(ScalarFormatter())
20ax.yaxis.major.formatter._useMathText = True
21ax.yaxis.set_minor_locator(  AutoMinorLocator(5))
22ax.xaxis.set_minor_locator(  AutoMinorLocator(5))
23ax.yaxis.set_label_coords(0.63,1.01)
24ax.yaxis.tick_right()
25nameOfPlot = 'GDP per hour (constant prices, indexed to 2007)'
26plt.ylabel(nameOfPlot,rotation=0)
27ax.legend(frameon=False, loc='upper left',ncol=2,handlelength=4)
28plt.savefig(os.path.join(dirFile,'ProdCountries.pdf'),dpi=300)
29plt.show()
30
Francesco
23 Mar 2019
1xtick.labelsize: 16
2ytick.labelsize: 16
3font.size: 15
4figure.autolayout: True
5figure.figsize: 7.2,4.45
6axes.titlesize : 16
7axes.labelsize : 17
8lines.linewidth : 2
9lines.markersize : 6
10legend.fontsize: 13
11mathtext.fontset: stix
12font.family: STIXGeneral
13
similar questions
queries leading to this page
make a effective figure in python