072203 - Commodity Price Figure

題目敘述 Problems Description:

請用pandas librarymatplotlib library來分別取出所有 Price≥1000 與 1000>Price≥500 的商品,再將其4,5月的所有 價格 標出並繪製成線形圖,以及Change% 標出並繪製成點線圖,然後上下合併成一張圖。

Please use pandas library and matplotlib library to take all the products of Price≥1000 and 1000>Price≥500 respectively, and then mark all their Prices in April and May, and draw them into a linear graph. Also, mark Change% and draw them into a dot-line graph. In the end, merge it up and down into one graph.

輸入說明 Input Description:

請點擊下方連結以下載CSV檔案。

Please click this link to download the CSV file.

<<< Commodity Price Source >>>

注意 Notice: 請在交作業前,將讀取csv的路徑改成.\src\CommodityPrice.csv。 Please change the path to read csv to .\src\CommodityPrice.csv before submitting the homework.

輸出說明 Output Description:

共兩張圖,每張圖皆由上下兩張子圖合併而成。輸出時須將其中的年份拿掉,且將每條線的label名稱標上並顯示出來,而圖表、x軸和y軸的標題名稱也需標示出來。

  • 價格線形圖:

    • y軸範圍落在 1000 ~ 3000,線的顏色不指定。(Price ≥ 1000)

    • y軸範圍落在 500 ~ 1000,線的顏色不指定。(1000 > Price ≥ 500)

  • Change% 點線圖:

    • 點需要用'.'和'o'以外的點樣式來標示,線請用實線以外的線來標示。

    • 需要加上格線,y軸範圍落在-15 ~ +15 (Price ≥ 1000)以及-5 ~ +5 (1000 > Price ≥ 500),線的顏色不指定。

    • Price ≥ 1000 與 1000 > Price ≥ 500 商品的點線樣式需不同。

此外,請將兩張圖儲存在當下路徑的.\img\commodity price資料夾中!

There are two pictures in total, and each picture is formed by merging the upper and lower sub-figures. When outputting, you need to remove the year from the date and need to mark and display the label name of each line. Besides, The title names of the chart, x-axis, and y-axis must be marked.

  • Price line graph:

    • The range of the y-axis falls within 1000 ~ 3000, and the color of the line is not specified.(Price ≥ 1000)

    • The range of the y-axis falls within 500 ~ 1000, and the color of the line is not specified.(1000 > Price ≥ 500)

  • Change% dot-line graph:

    • The dots need to be in a dot style other than '.' and 'o'. To mark, please mark the line with a line other than a solid line.

    • Need to add a grid line, they-axis range falls from -15 to +15(Price ≥ 1000) and -5 ~ +5(1000 > Price ≥ 500), and the color of the line is not specified.

    • Price ≥ 1000 and 1000 > Price ≥ 500 must have different dot and line styles.

Besides, please save these two figures in the .\img\commodity price folder of the current path.

注意 Notice: 請將圖片名稱命名為 你的名字_500to999你的名字_1000up。 Please give pictures a name your name_500to999your name_1000up.

輸入範例 Input Example:

None

輸出範例 Output Example:

  • Commodity Price greater and equal than 1000

  • Commodity Price greater and equal than 500 and less than 1000

最后更新于

这有帮助吗?