After a long time I returned to Python again and I am currently replicating some data with Matplotlib from the following graph:
The code is the following:
x_1=[0.000,100.943,150.943,201.887,250.943,350.000]
y_1=[0.000,28.135,56.269,85.933,99.388,100.000]
plt.xlim(0,400)
plt.ylim(0,100)
plt.title('(a)')
plt.ylabel('Elimnación de TPHs (%)')
plt.xlabel('Temperatura (°C)')
for pos in ['right', 'top']:
plt.gca().spines[pos].set_visible(False)
plt.plot(x_1,y_1,'ok-', markersize=15)
plt.show()
plt.savefig('3.1 (a).png')
When I run the code I get the following:
How can I make the plot data not look 'clipped' without having to change the bounds? and How can I scale the x-axis so that it is 100 by 100 with all the numbers?
How can I make the plot data not look 'clipped' without having to change the bounds?
Set
clip_on=False
as argument ofplt.plot
:How can I scale the x axis so that it is 100 by 100 with all the numbers?
Use
plt.xticks
and set the values you want to plot. In this case, from 0 to 400 with an increment of 100:Equivalently using
numpy
: