Is it possible to use a Mosfet in switching mode as an electronic load?
the problem is that it doesn't produce the real IV curve, it shows a
  linear function.


Your PWM is shorting out the solar panel when on and open-circuiting it when off, so you are just getting an average of the open circuit voltage multiplied by the PWM ratio.

To get a proper IV curve you have to draw power (ie. Volts x Amps) from the panel, and that power will have to be dissipated somewhere.

You could put several FETs in parallel so that each one stays within its rating, with large heatsinks and forced air cooling. To reduce maximum FET dissipation you could put high power resistors in series that drop about half the voltage at the panel's expected maximum power point.  

Or you could just switch in high power resistors of progressively lower values in parallel. If each resistor value is half the previous one then you can input a binary code and have a 'digital resistor', like this:-







simulate this circuit &ndash; Schematic created using CircuitLab

The FETs switching the higher value resistors can be rated lower because they are switching less current. For the higher power resistors you could parallel several lower wattage resistors eg. 5 x 10&ohm; 25W in parallel would make a 2&ohm; 125W resistor. Forced air cooling can also be used to run the resistors up to (or over!) their power ratings (ratings in my diagram are based on a panel with open circuit voltage of 22V and MPP of 15Vx8A).

This is the scheme I use for discharge testing of high capacity Lipo batteries, except I just have a row of toggle switches which I operate manually to get the desired load current.