I have a data file that includes several years' temperature records, I read-in the data file with Pandas and now it becomes a DataFrame below:
In [86]: tso
Out[86]:
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 28170 entries, 2005-05-20 13:28:42.239999+00:00 to 2012-12-05 13:26:49.919999+00:00
Data columns:
Day 28170 non-null values
Month 28170 non-null values
Year 28170 non-null values
Temp 28170 non-null values
dtypes: float64(1), int64(3)
then I plot them according to 'Month'and 'year'columns:
ax=tso.groupby(['Month','Year']).mean().unstack().plot(linewidth=3,legend=False)
patches,labels=ax.get_legend_handles_labels()
ax.legend(unique(tso['Year'].values),loc='best')
plt.show()
now I want the last year's temperatures are plotted by thick line. What should I do?Is there any solution simple? Thank you!
When the line is selected you should see Drawing Tools tab added at the top of the screen above the Ribbon. Click this tab. In the Shape Styles block click Shape Outline. In the dropdown, move the cursor over Weight and then across to the right to select the required line thickness.
If you want to make the line width of a graph plot thinner, then you can make linewidth less than 1, such as 0.5 or 0.25. If you want to make the line width of the graph plot thicker, then you can make linewidth greater than 1. This thickens the graph plot.
You could do something like:
ax.lines[-1].set_linewidth(8)
plt.show()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With