Draw a graph of \$y=(-n)^x\$ Challenge

Given an input of an integer, \$n\$ (where \$0&lt;n&lt;50\$), output the graph of \$y=\mathrm{Re}((-n)^x)\$ from \$x = -3\$ to \$x = 3\$ inclusive. 

Where \$\mathrm{Re}(p)\$ is the real part of the complex number \$p\$.

Note that \$\mathrm{Re}((-n)^x) = n^x \cos{(\pi x)}\$

Output

The output may be in any form you wish (e.g. an image or a window etc.). ASCII art is disallowed.

The graph does not need to have axes (to allow languages without built-in graphing functions to compete).

If an image is output, it each side must be longer than 500 pixels. Similarly, the plot must fill the image as best it can.

The minimum interval between plots is 0.05.

Vector graphics are allowed.

Examples

For an input of 2:



For an input of 1:





You must put your corresponding outputs in your answer (n = 1 and n = 2).

Winning

The shortest code in bytes wins.
TI-Basic, 26 21 bytes
~3→Xmin
3→Xmax
Prompt N
DrawF N^Xcos(πX

Output for N=2: