Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Minor cleanup. Thanks grammarly.
  • Loading branch information
dilawar authored Jul 25, 2024
1 parent c2e5440 commit fb62b9e
Showing 1 changed file with 23 additions and 29 deletions.
52 changes: 23 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ $ plotdigitizer --help

## Preparing image

Crop the image and leave only axis and trajectories. I use
`gthumb` utility on Linux. You can also use imagemagick or gimp.
Crop the image and leave only axis and trajectories. I used the `gthumb` utility on Linux.
You can also use `imagemagick` or `gimp`.

Following image is from MacFadden and Koshland, PNAS 1990 after trimming. One
can also remove top and right axis.
The following image is from MacFadden and Koshland, PNAS 1990 after trimming. One
should also remove top and right axes. I didn't because I want to highlight the
limitation of this tool!

![Trimmed image](./figures/trimmed.png)

Expand All @@ -30,19 +31,20 @@ __Run__
plotdigitizer ./figures/trimmed.png -p 0,0 -p 10,0 -p 0,1
```

We need at least three points (`-p` option) to map axes onto the image. In the example
above, these are `0,0` (where x-axis and y-axis intesect) , `10,0` (a point on
x-axis) and `0,1` (a point on y-axis). To map these points on the image, you
will be asked to click on these points on the image. _Make sure to click in
the same order and click on the points as precisely as you could. Any error in
this step will propagate._ If you don't have `0,0` in your image, you have to provide
4 points: 2 on x-axis and 2 on y-axis.
We need at least three points (`-p` option) to map x- and y-axis onto the image.

The data-points will be dumped to a csv file specified by __`--output
In the example above, these are `0,0` (where x-axis and y-axis intersect) , `10,0` (a point on
the x-axis), and `0,1` (a point on the y-axis). To map these points on the image, you
will be asked to click on these points. _Make sure to click in the same order and click on
the points as precisely as you could. Any error in this step will propagate._

If you don't have `0,0` in your image, you must provide 4 points: 2 on the x-axis and 2 on the y-axis.

The data points will be dumped to a CSV file specified by __`--output
/path/to/file.csv`__.

If `--plot output.png` is passed, a plot of the extracted data-points will be
saved to `output.png`. This requires `matplotlib`. Very useful when debugging/testing.
If `--plot output.png` is passed, a plot of the extracted data points will be
saved to `output.png`. This requires matplotlib. Very useful when debugging/testing.

![](./figures/traj.png)

Expand All @@ -51,7 +53,7 @@ Notice the error near the right y-axis.
## Using in batch mode

You can pass the coordinates of points in the image at the command prompt.
This allows to run in the batch mode without any need for the user to click on
This allows it to run in batch mode without any need for the user to click on
the image.

```bash
Expand All @@ -61,9 +63,9 @@ plotdigitizer ./figures/trimmed.png -p 0,0 -p 20,0 -p 0,1 -l 22,295 -l 142,295 -
### How to find coordinates of axes points

In the example above, point `0,0` is mapped to coordinate `22,295` i.e., the
data point `0,0` is on the 22nd row and 295th column of the image (_assuming that bottom left
of the image is first row, first column `(0,0)`_). I have included an utility
`plotdigitizer-locate` (script `plotdigitizer/locate.py`) which you can use to
data point `0,0` is on the 22nd row and 295th column of the image (_assuming that the bottom left
of the image is the first row, first column `(0,0)`_). I have included a utility
`plotdigitizer-locate` (script `plotdigitizer/locate.py`), which you can use to
find the coordinates of points.


Expand All @@ -77,15 +79,14 @@ or, by directly using the script:
$ python3 plotdigitizer/locate.py figures/trimmed.png
```

This command opens the image in a simple window. You can click on a point and
its coordinate will be written on the image itself. Note them down.
This command opens the image in a simple window. You can click on a point, and
its coordinates will be written on the image. Note them down.

![](./figures/trimmed_locate.png)


# Examples


### Base examples

```bash
Expand Down Expand Up @@ -130,7 +131,7 @@ the detection below it.__

# Limitations

This application has following limitations:
This application has the following limitations:

- Only b/w images are supported for now. Color images will be converted to grayscale upon reading.
- Each plot should have only one trajectory.
Expand All @@ -143,10 +144,3 @@ Open an issue and please attach the sample plot.

1. [WebPlotDigitizer](https://automeris.io/WebPlotDigitizer/) by Ankit
Rohatagi is very versatile.


## Notes

- grapvhiz version 2.47.2 is broken for some xml files. See
<https://forum.graphviz.org/t/assert-sz-2-in-convertsptoroute/689>. Please use a
different version.

0 comments on commit fb62b9e

Please sign in to comment.