1

When I use plt.plot(x,y) I get the following in Spyders plot display by default:

enter image description here

However, I want:

enter image description here

black axes lines and white background. How do I set this?

ax4.axes.get_xaxis().set_visible(True) 
ax4.spines['bottom'].set_color('black')
ax4.tick_params(axis='x', colors='black')
ax4.tick_params(axis='y', colors='black')

did not work.

Code to get default:

fig = plt.figure(figsize=(8.5,11)) 
ax4 = fig.add_subplot(3,1,2)

Dist25 = np.load('Dist25.npy')

Dist100 = np.load('Dist100.npy') 


r =1 
#
ax4.plot(Dist25[0::r,3],Dist25[0::r,0],'or', color = 'xkcd:azure')
ax4.plot(Dist100[0::r,3],Dist100[0::r,0],'<r', color = 'xkcd:chartreuse')
 


ax4.set_xscale('log')


ax4.set_ylim((1.5,2.5))


ax4.fill_between(Dist25[0::r,3], Dist25[0::r,0] - Dist25[0::r,1], Dist25[0::r,0] + Dist25[0::r,1],
                 color='xkcd:azure', alpha=0.2)




ax4.fill_between(Dist100[0::r,3], Dist100[0::r,0] - Dist100[0::r,1], Dist100[0::r,0] + Dist100[0::r,1],
                 color='xkcd:chartreuse', alpha=0.2)




for tick in ax4.xaxis.get_majorticklabels():  # example for xaxis
    tick.set_fontsize(18)

for tick in ax4.yaxis.get_majorticklabels():  # example for xaxis
    tick.set_fontsize(18)

ax4.set_title('B) Distance from chain', fontsize = 25) 
ax4.set_xlabel('Simulation time (ps)', fontsize = 20) 
ax4.set_ylabel('Distance (nm)', fontsize = 20)
Pdeuxa
  • 651
  • 7
  • 27

1 Answers1

0

I solved this by adding: plt.style.use('classic') to my code :)