Simplifying plots (reducing data points)?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Simplifying plots (reducing data points)?

Neal Becker
I produced a line plot as:
ax.plot (x, y, '.')
and saved as pdf.

Both x and y were large vectors, resulting in a large pdf, and when incorporated into a LaTeX document, the resulting pdf takes a long time to open.

Other than my manually decimating the vectors:
ax.plot (x[::100], y[::100], '.')

Is there some way within mpl to simplify plots?  Or perhaps post-processing the pdf?

Thanks,
Neal

--
Those who don't understand recursion are doomed to repeat it

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Simplifying plots (reducing data points)?

matplotlib - users mailing list
I don't know if it is acceptable to you, but may be producing a png file
would be an option (latex would accept it).
Regards,
        Juan

El 10/2/20 a las 10:21 AM, Neal Becker escribió:

> I produced a line plot as:
> ax.plot (x, y, '.')
> and saved as pdf.
>
> Both x and y were large vectors, resulting in a large pdf, and when
> incorporated into a LaTeX document, the resulting pdf takes a long time
> to open.
>
> Other than my manually decimating the vectors:
> ax.plot (x[::100], y[::100], '.')
>
> Is there some way within mpl to simplify plots?  Or perhaps
> post-processing the pdf?
>
> Thanks,
> Neal
>
> --
> /Those who don't understand recursion are doomed to repeat it/
>
> _______________________________________________
> Matplotlib-users mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Simplifying plots (reducing data points)?

Neal Becker
Yes, I considered this.  But to produce publication quality documents I've learned to avoid bitmap graphics.

On Fri, Oct 2, 2020 at 9:40 AM fiolj <[hidden email]> wrote:
I don't know if it is acceptable to you, but may be producing a png file
would be an option (latex would accept it).
Regards,
        Juan

El 10/2/20 a las 10:21 AM, Neal Becker escribió:
> I produced a line plot as:
> ax.plot (x, y, '.')
> and saved as pdf.
>
> Both x and y were large vectors, resulting in a large pdf, and when
> incorporated into a LaTeX document, the resulting pdf takes a long time
> to open.
>
> Other than my manually decimating the vectors:
> ax.plot (x[::100], y[::100], '.')
>
> Is there some way within mpl to simplify plots?  Or perhaps
> post-processing the pdf?
>
> Thanks,
> Neal
>
> --
> /Those who don't understand recursion are doomed to repeat it/
>
> _______________________________________________
> Matplotlib-users mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users
>


--
Those who don't understand recursion are doomed to repeat it

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Simplifying plots (reducing data points)?

Phlya
How about rasterizing just the plot? plt.plot(x, y, rasterized=True) should work I think.

пт, 2 окт. 2020 г. в 14:52, Neal Becker <[hidden email]>:
Yes, I considered this.  But to produce publication quality documents I've learned to avoid bitmap graphics.

On Fri, Oct 2, 2020 at 9:40 AM fiolj <[hidden email]> wrote:
I don't know if it is acceptable to you, but may be producing a png file
would be an option (latex would accept it).
Regards,
        Juan

El 10/2/20 a las 10:21 AM, Neal Becker escribió:
> I produced a line plot as:
> ax.plot (x, y, '.')
> and saved as pdf.
>
> Both x and y were large vectors, resulting in a large pdf, and when
> incorporated into a LaTeX document, the resulting pdf takes a long time
> to open.
>
> Other than my manually decimating the vectors:
> ax.plot (x[::100], y[::100], '.')
>
> Is there some way within mpl to simplify plots?  Or perhaps
> post-processing the pdf?
>
> Thanks,
> Neal
>
> --
> /Those who don't understand recursion are doomed to repeat it/
>
> _______________________________________________
> Matplotlib-users mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users
>


--
Those who don't understand recursion are doomed to repeat it
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Simplifying plots (reducing data points)?

Paul Hobson-2
In reply to this post by Neal Becker
Neal,

-paul

On Fri, Oct 2, 2020 at 6:22 AM Neal Becker <[hidden email]> wrote:
I produced a line plot as:
ax.plot (x, y, '.')
and saved as pdf.

Both x and y were large vectors, resulting in a large pdf, and when incorporated into a LaTeX document, the resulting pdf takes a long time to open.

Other than my manually decimating the vectors:
ax.plot (x[::100], y[::100], '.')

Is there some way within mpl to simplify plots?  Or perhaps post-processing the pdf?

Thanks,
Neal

--
Those who don't understand recursion are doomed to repeat it
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Simplifying plots (reducing data points)?

Neal Becker
I didn't change it from the default.  Guess I could try changing 'path.simplify_threshold'

On Fri, Oct 2, 2020 at 11:55 AM Paul Hobson <[hidden email]> wrote:
Neal,

-paul

On Fri, Oct 2, 2020 at 6:22 AM Neal Becker <[hidden email]> wrote:
I produced a line plot as:
ax.plot (x, y, '.')
and saved as pdf.

Both x and y were large vectors, resulting in a large pdf, and when incorporated into a LaTeX document, the resulting pdf takes a long time to open.

Other than my manually decimating the vectors:
ax.plot (x[::100], y[::100], '.')

Is there some way within mpl to simplify plots?  Or perhaps post-processing the pdf?

Thanks,
Neal

--
Those who don't understand recursion are doomed to repeat it
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


--
Those who don't understand recursion are doomed to repeat it

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users