DSMix Plot: VB Plotting the Hard Way (refers to 4011\VBPrograms\DSmix folder)

In this exercise, we will plot points of a line using VBExpress. By default, VBExpress plots from the top left to the bottom right, which differs from how you were taught to make a graph (origin at lower left). We have to fix that first.

Use VBExpress to make a form that looks like this:

The rectangle at the lower left is a Picture Box called PictureBox1. I used the Properties Box to set its size to 100 x 100, but this shouldn’t matter.

Attach the code below to the “Draw From Top Left” button to make a plot that’s top-to-bottom plot (i.e., wrong) of ten points on the line x = y:

When it’s working, you should see 10 points descending from the top left if you press the “Draw from Top Left” button.

PART A.

Now, design some code that will work for a picture box of arbitrary size to attach to the “Draw from Bottom Left” button to make the plot look normal instead, like this:

PART B.

Keeping the box at its same size, plot the sine function from 0 – 360 degrees as 360 separate points (tiny circles). The x-axis scale and the y-axis scale have to be adjusted and offset to do this. Here’s how it should look when you get it right.


PART C.

Now finally, let’s use our new-found “do-it-the-hard-way” skills to plot DSmix = -nR[u1ln(u1) + u2ln(u2)]. If u represents mole fraction, that’s the usual ideal entropy of mixing; if instead u represents volume fraction, it’s the Flory-Huggins result. Your plot should look like this: