Question: this is my first time asking a question here. I am very new to programming and not very gifted, I am currently working on a small little program where I try to plot EURUSD prices against dates, I have been experiencing a problem of not being able to plot the dates on the x-axis. I have been looking around the web for help and answers but without any great luck. Anyway, heres my code so far:

```
j=1
dates = []
price = []
with open('EURUSD_day.csv', 'r') as f:
    reader = csv.reader(f)
    print (f)
    for row in reader:
        if j > 1:
        dates.append(row[1])
        dates.append(float(row[6]))
    j = j + 1
import datetime as dt
dates = []
x = [dt.datetime.strptime(d, '%m/%d/%Y').date() for d in dates]
y = range(len(x))
plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%m/%d/%Y'))
plt.plot
plt.gcf().autofmt_xdate
plt.show()

```

I thank you for any and all help!

Answer: 
The following code saved my ass today. I'm happy that I solved it.

```
def store_dimensions
     if file && model
      width, height = ::MiniMagick::Image.open(file.file)[:dimensions]
        if width>700
              Rails.logger.info "#{width}"
              finalHeight=((700*height)/width)
              self.class.version :best_fit do
                process :resize_to_fill => [700,finalHeight]
              end

        else
              Rails.logger.info "#{width}"
              self.class.version :best_fit do
                process :resize_to_fill => [width,height]
              end
        end
      end
end

#run the store_dimensions methods
  process :store_dimensions

```
For any lost wanderers, this is what you're looking for:

```
class Uploader
  version :my_version do
    process :my_processor
  end

  def my_processor
    # model is available here!

    manipulate! do |img|
      img.combine_options do |cmd|
        cmd.resize [model.width, model.height].join('x')
      end

      img
    end
  end
end

```

Example of [custom process method](https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/processing/mini_magick.rb#L136)